Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is unique branch #79

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Is unique branch #79

wants to merge 3 commits into from

Commits on Oct 30, 2020

  1. Another O(N) solution using an Object

    Another solution without additional data structures but using objects, with performance O(N).
    
    function isUnique3(str){
    let obj = {}
    for( let elem of str){
      if(obj.hasOwnProperty(elem)) obj[elem]++
      else obj[elem]=1
    }
    for( key in obj){
      if (obj[key]=== 1) return true
      else return false
    }
    } 
    
    isUnique3('ada') // false
    isUnique3("golden") // true
    Ada-11 authored Oct 30, 2020
    Configuration menu
    Copy the full SHA
    40e9431 View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2020

  1. isUnique

    Ada-11 committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    d134a13 View commit details
    Browse the repository at this point in the history
  2. isUnique with Obj

    Ada-11 committed Dec 23, 2020
    Configuration menu
    Copy the full SHA
    b7e7c39 View commit details
    Browse the repository at this point in the history