Skip to main content

Posts

Showing posts with the label Rotated Sorted Array

Learn how to improve communication as an IT fresher with practical tips for meetings, managers, seniors, English, updates, blockers, and workplace messages.

How to Improve Communication as an IT Fresher You can be good at Java, Python, React, SQL, testing, or whatever technology your project uses and still feel completely lost when someone says, “Can you explain what you did?” This is especially common when you are an IT fresher. You may know the answer in your head, but the moment you have to speak in a meeting, talk to a senior developer, ask your manager a question, or explain a technical problem in English, you suddenly start overthinking every sentence. If this sounds familiar, you are not alone. And you do not need perfect English, a foreign accent, or an impressive vocabulary to communicate well at work. Good workplace communication is much simpler: be clear, concise, respectful, honest, and easy to understand. The good news is that communication is a skill you can improve through everyday work. You do not have to become a completely different person. You simply need to become better at explaining what you know, asking wha...

33. Search in Rotated Sorted Array

33. Search in Rotated Sorted Array LeetCode 33 – Search in Rotated Sorted Array is a classic binary search problem. The important part is not simply finding the target, but finding it in O(log n) time even though the sorted array has been rotated. The key observation is that, at any point during binary search, at least one half of the current search range will always be sorted . 📄 Problem Statement You are given an integer array nums that was originally sorted in ascending order. All elements are distinct. The array may have been rotated around an unknown pivot. For example: Original: [0,1,2,4,5,6,7] Rotated: [4,5,6,7,0,1,2] You are also given an integer target . Return the index of target if it exists in the array. Otherwise, return -1 . The solution must run in: O(log n) time. 📚 Examples Example 1: Input: nums = [4,5,6,7,0,1,2] target = 0 Output: 4 The target 0 is present at index 4 . Example 2: Input: nums = [4,5,6,7,0,1,2] target = 3 O...