---
title: "Discussion on \"Problem 34. Find First and Last Position of Element in Sorted Array [Medium]\" | Hashnode"
description: "Discussion on \"Problem 34. Find First and Last Position of Element in Sorted Array [Medium]\". Description\nGiven an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.\nIf target is not found in the array, return [-1, -1].\nYou must write an algorithm with O(log n) runtime complex..."
url: "https://hashnode.com/posts/problem-34-find-first-and-last-position-of-element-in-sorted-array-medium/685a0eea9296b43ed2ce4935"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Problem 34. Find First and Last Position of Element in Sorted Array \[Medium\]](https://learncodedaily.hashnode.dev/problem-34-find-first-and-last-position-of-element-in-sorted-array-medium?utm_source=hashnode&utm_medium=feed)

Description Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return \[-1, -1\]. You must write an algorithm with O(log n) runtime complex...

Jun 24, 2025 · 3 min read · learncodedaily.hashnode.dev  
Read the article

-   [#leetcode](https://hashnode.com/tag/leetcode)
-   [#binary-search-algorithm](https://hashnode.com/tag/binary-search-algorithm)

## Written by

[Michael Peattie](https://hashnode.com/@physics2comp)

@physics2comp

  
[View profile](https://hashnode.com/@physics2comp)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
