[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/arjunmullick/coding-Interview/master/FindDuplicateNumber.java [Back]  [Original]

package com.leetcode;

import java.util.Arrays;

public class FindDuplicateNumber {

    //https://leetcode.com/problems/find-the-duplicate-number/
    class Solution {
        public int findDuplicate(int[] nums) {
            int n = nums.length;
            int l = 1;//[1,n] number to search
            int r = n-1;

            while(l

Web Proxy Viewer  |  New URL  |  Original Page