Sollicitatievraag bij Google

Implement strcmp() (string compare)

Antwoorden op sollicitatievragen

Anoniem

17 aug 2019

/* Time - O(n) where n is the time length of either a or b Space - O(1) Compare whether the two input strings are equivalent */ private static boolean strCmp(String a, String b) { if(a.length() != b.length()) { return false; } for(int i=0; i

Anoniem

17 aug 2019

/* Time - O(n) where n is the time length of either a or b Space - O(1) Compare whether the two input strings are equivalent */ private static boolean strCmp(String a, String b) { if(a.length() != b.length()) { return false; } for(int i=0; i

Anoniem

5 aug 2021

def strcmp(str1, str2): if str1 == str2: return True return False