34. Find First and Last Position of Element in Sorted Array

34. Find First and Last Position of Element in Sorted Array

Input: nums = [5,7,7,8,8,10], target = 8
Output: [3,4]
Input: nums = [5,7,7,8,8,10], target = 6
Output: [-1,-1]
Input: nums = [], target = 0
Output: [-1,-1]

--

--

--

Consistency achieves everything https://github.com/paigekim29

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Veteran Developer Matt Lung Joins MDT as Senior Software Engineer

Overview:

Pieces of Advice for Junior Developers and Developer Candidates Vol. 3742

BOOTSTRAP WITH RUBY ON RAILS — The MVC

The what & how of Heroku — Deploying apps the faster way.

Django Girls Workshop — Week 1

Using Vault To Generate Temporary AWS Credentials For API Invocation

Host Your Unity Game!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Joo Hee Paige Kim

Joo Hee Paige Kim

Consistency achieves everything https://github.com/paigekim29

More from Medium

Analyze Big O’ Notation and save your valuable reputation

Mastering Recursion For Beginners-(Part 3)

How to solve Leetcode 1. Two Sum