Post by Shahana Shaik

Aspiring software developer | Java Programmer | Web Developer | Cybersecurity Enthusiast | Published Researcher

Hey Connections! šŸš€ Day 28 of 160 Days of Code 🧩 Problem Solved: Number of Occurrence šŸ’» Language: Java šŸ“ Platform: GeeksforGeeks āœ… Result: All test cases passed successfully šŸŽÆ šŸ’” Key Learning: Even though this simple linear solution works fine, because the array is sorted, we can use binary search to optimize the solution. With binary search, we can find the first occurrence and last occurrence of the target, and calculate the frequency in O(log n) time ā±. 🌱 Sometimes solving in a straightforward way is the first step, then comes optimizing for efficiency šŸš€ #Day28 #160DaysOfCode #Java #ProblemSolving #GeeksforGeeks #DSA #Arrays #CodingJourney #ShahanaCodes #WomenInTech

Post content