Conversation
|
Your solution for the "First and Last Position" problem is excellent. It correctly implements two binary searches to find the first and last occurrence of the target. The code is efficient and meets the O(log n) requirement. Well done! However, note that you have included solutions for other problems in the same submission. For future assignments, make sure to submit only the solution for the problem being evaluated. This helps in avoiding confusion and ensures that the evaluator focuses on the correct code. One very minor suggestion: in the getFirst and getLast methods, you are passing the entire array and target each time. Since these are the same for both calls, you could consider making them class fields or simply not passing them (if you were to write in a class context where they are accessible). But the current approach is perfectly acceptable. Keep up the good work! |
No description provided.