CODE CLUB
CODE CLUB
CODE CLUB
CODE CLUB
MEETING ONE JAN 31 2024
CODE CLUB
CODE CLUB
CODE CLUB
WARMUP
Given a string s consisting of words and spaces, return the length of the last word in the string.
A word is a maximal substring consisting of non-space characters only.
CODE CLUB
CODE CLUB
CODE CLUB
Input: "Hello World"
Output: 5
Explanation: The last word is "World" with length 5.
Input: " fly me to the moon " Output: 4
Input: "luffy is still joyboy" Output: 6
WARMUP
Given a string s consisting of words and spaces, return the length of the last word in the string.
A word is a maximal substring consisting of non-space characters only.
CODE CLUB
CODE CLUB
CODE CLUB
Input: "Hello World"
Output: 5
Explanation: The last word is "World" with length 5.
Input: " fly me to the moon " Output: 4
Input: "luffy is still joyboy" Output: 6
LEETCODE PROBLEM #58
AGENDA
CODE CLUB
CODE CLUB
CODE CLUB
What do you want coding club to be about?
#1 Writing Code
Discussing the Foundations of Computer Science?
Making Games?
Learning Specific Languages?
AI? + 1
Telling Coding Related Jokes? + 1
Asking for Help With Code Related Projects + 1
CODE CLUB
MEETING TWO WED 7 2024
CODE CLUB
CODE CLUB
CODE CLUB
CODE CLUB
AGENDA
CODE CLUB
CODE CLUB
CODE CLUB
REVIEW LAST WEEK (5min)
WARMUP (30 min)
IDEAS FOR NEXT WEEK (25 min)
WARMUP
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
CODE CLUB
CODE CLUB
CODE CLUB
Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].
LEETCODE #1
CODE CLUB
MEETING THREE WED Feb 21 2024
CODE CLUB
CODE CLUB
CODE CLUB
CODE CLUB
AGENDA
CODE CLUB
CODE CLUB
CODE CLUB
COLLECT CODE BASED PROJECTS (20 MINUTES)
WARMUP (10 min)
DISCUSS CODE FROM BEFORE (30 min)
https://leetcode.com/problems/length-of-last-word/description/
PROBLEM ONE
Given a string s consisting of words and spaces, return the length of the last word in the string.
A word is a maximal substring consisting of non-space characters only.
JAVA
PYTHON
class Solution
{
public int lengthOfLastWord(String s)
{
String[] ss = s.split(" ");
return ss[ss.length - 1].length();
}
}
class Solution(object):
def lengthOfLastWord(self, s):
#ss for substring
ss = s.strip().split(' ')
return len( ss[len(ss) - 1] )
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
PROBLEM TWO
PYTHON
JAVA