It was accepted...


  • 8
    U

    public class Solution { public int lengthOfLastWord(String s) { String ss = s.trim(); return ss.length() - 1 - ss.lastIndexOf(' '); } }


Log in to reply
 

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