6ms java solution


  • 2
    C
        char [] a =s.toCharArray();
    	char [] b =t.toCharArray();
    	Arrays.sort(a);Arrays.sort(b);
    	
    	if(String.valueOf(a).equals(String.valueOf(b)))
    		return true;
    	else
    		return false;

  • 0
    P

    Arrays.sort() is implemented using Dual-Pivot Quicksort, which offers O(n*logn).


Log in to reply
 

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