filmov
tv
Leetcode 2042 Check if Numbers Are Ascending in a Sentence Java Clean Solution Explained

Показать описание
Leetcode 2042 Check if Numbers Are Ascending in a Sentence Java Clean Solution Explained Time Complexity O(N)
If you find this video helpful, please 'Like' or 'Subscribe'.
This is really helpful for the channel and also motivates me to do more of such good videos.
Link To The Problem:
Problem Description:
A sentence is a list of tokens separated by a single space with no leading or trailing spaces. Every token is either a positive number consisting of digits 0-9 with no leading zeros, or a word consisting of lowercase English letters.
For example, "a puppy has 2 eyes 4 legs" is a sentence with seven tokens: "2" and "4" are numbers and the other tokens such as "puppy" are words.
Given a string s representing a sentence, you need to check if all the numbers in s are strictly increasing from left to right (i.e., other than the last number, each number is strictly smaller than the number on its right in s).
Return true if so, or false otherwise.
#coding #softwareengineer #Leetcode #Algorithm #DataStructure #Java #programmer #tech #software #codinglife #Preparation
#interview #programminglife #programmingisfun
If you find this video helpful, please 'Like' or 'Subscribe'.
This is really helpful for the channel and also motivates me to do more of such good videos.
Link To The Problem:
Problem Description:
A sentence is a list of tokens separated by a single space with no leading or trailing spaces. Every token is either a positive number consisting of digits 0-9 with no leading zeros, or a word consisting of lowercase English letters.
For example, "a puppy has 2 eyes 4 legs" is a sentence with seven tokens: "2" and "4" are numbers and the other tokens such as "puppy" are words.
Given a string s representing a sentence, you need to check if all the numbers in s are strictly increasing from left to right (i.e., other than the last number, each number is strictly smaller than the number on its right in s).
Return true if so, or false otherwise.
#coding #softwareengineer #Leetcode #Algorithm #DataStructure #Java #programmer #tech #software #codinglife #Preparation
#interview #programminglife #programmingisfun