Skip to content
Snippets Groups Projects

Search Insert Position

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Kiryuu Sakuya
    Program.cs 333 B
    public class Solution {
        public int SearchInsert(int[] nums, int target) {
            int num = 0;
                for (int i = 0; i < nums.Length; i++)
                {
                    if (target <= nums[i])
                    {
                        break;
                    }
                    num++;
                }
                return num;
        }
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment