Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Google Applied CS - Day 1
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Harsh Vakharia
March 28, 2016
Education
0
130
Google Applied CS - Day 1
Day 1:
Anagram (HashSet, HashMap and ArrayList) and Scarne's dice
Harsh Vakharia
March 28, 2016
Tweet
Share
More Decks by Harsh Vakharia
See All by Harsh Vakharia
Google Applied CS - Day 4
harshjv
0
42
Google Applied CS - Day 3
harshjv
0
53
Google Applied CS - Introduction
harshjv
0
41
Other Decks in Education
See All in Education
栃木にいても「だいじ」だっぺ〜! 栃木&全国アジャイルコミュニティへの参加・運営の魅力
sasakendayo
1
140
KBS新事業創造体験2025_科目説明会
yasuchikawakayama
0
160
【dip】「なりたい自分」に近づくための、「自分と向き合う」小さな振り返り
dip_tech
PRO
0
230
Padlet opetuksessa
matleenalaakso
10
15k
滑空スポーツ講習会2025(実技講習)EMFT講習 実施要領/JSA EMFT 2025 procedure
jsaseminar
0
100
Activité_5_-_Les_indicateurs_du_climat_global.pdf
bernhardsvt
0
140
160人の中高生にAI・技術体験の講師をしてみた話
shuntatoda
1
300
Evaluation Methods - Lecture 6 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.3k
JAPAN AI CUP Prediction Tutorial
upura
2
660
Microsoft Office 365
matleenalaakso
0
2.1k
子どものためのプログラミング道場『CoderDojo』〜法人提携例〜 / Partnership with CoderDojo Japan
coderdojojapan
PRO
4
18k
2025年の本当に大事なAI動向まとめ
frievea
0
170
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Odyssey Design
rkendrick25
PRO
1
490
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Done Done
chrislema
186
16k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Transcript
GOOGLE'S APPLIED CS WITH ANDROID DAY 1
ANAGRAMS
WHAT IS AN ANAGRAM? An anagram is a word formed
by rearranging the letters of another word. — Wikipedia
EXAMPLE Cinema is an anagram of iceman.
MECHANICS 1. Provide user a word from the dictionary. 2.
The user tries to create as many words as possible that contain all the letters of the given word plus one additional letter. 3. The user can give up and see the words that they did not guess.
CATCH The addition of extra letter at the beginning or
the end without reordering the other letters is not valid.
MEANING If the game picks the word 'ore' as a
starter, the user might guess 'rose' or 'zero' but not 'sore'. i.e. 1. rose ✅ 2. s(ore) ❌
STARTER CODE
ANAGRAMDICTIONARY'S CONSTRUCTOR WHAT IS NEEDED? 1. Word validation 2. Random
word selection 3. Get word's anagrams 4. Get words by length (ext)
WORD VALIDATION Set<String> wordSet = new HashSet<>(); ACCESS TIME: O(1)
RANDOM WORD SELECTION ArrayList<String> wordList = new ArrayList<>(); RANDOM ACCESS
TIME: O(1)
GET WORD'S ANAGRAMS Map<String, ArrayList<String>> lettersToWord = new HashMap<>(); ACCESS
TIME: O(1)
GET WORDS BY LENGTH Map<Integer, ArrayList<String>> sizeToWords = new HashMap<>();
SCARNE'S DICE
RULES 1. if they roll a 1, score no points
and lose their turn 2. if they roll a 2 to 6: ▸ add the rolled value to their points ▸ choose to either reroll or keep their score and end their turn
STARTER CODE
THIS IS IT FOR TODAY
ANY DOUBTS?