LeetCode: Length of Last Word in JAVA, using: methods, scanners, strings, scanner::next, hasNext

Опубликовано: 06 Февраль 2026
на канале: Computer Engineering life
35
2

What we did:
We take a String as a parameter.
Spaces are delimiters and we need to find the length of the last word.
We use a scanner to go through the string and then when at the last word return its length.

Problem:
https://leetcode.com/problems/length-...


More Java Practice Problems:
   • Java Assignments, Exercises, and Problems ...