Similar sol doesn't work

  • 0

    Re: Possible solutions.
    Anybody has got some idea, why below solution doesn't work . It says time limit exceeded.

    public boolean containsDuplicate(int[] nums) {

        final List<Integer> li = new ArrayList<Integer>();
        for (int i = 0; i < nums.length; i++) {
    			return true;
        return false;

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.