January 11, 2017
Review the longest palindrome string through code review.
Previous practices of the algorithm.
Practice I
Practice II
Actionable Items:
Write C# code using this code review.
Longest palindrome string - best review - no raw loop.
From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one. 2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会. She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going. Hard work beats talent when talent fails to work hard.
Wednesday, January 11, 2017
Tuesday, January 10, 2017
Code Review stackexchange.com ranking page - a short research
January 10, 2016
Introduction
Julia found out that she had 6% performance tag next to her name, and then she felt so good after she worked on them last 48 days. So, she decided to study the ranking page, spent over one hour to find something to work on.
Study the ranking statistics:
Research
Most of important, she found out the best algorithm teachers she can find, and learn from the answers.
1. score over 1122 points on JavaScript - link is here.
2. score 880 algorithm points - link is here.
3. score over algorithm 459 points - link is here.
4. score algorithm 200 points - link is palacsint.
4. Go through algorithm score ranking - link is here.
Study those top algorithm answerers:
Study those top algorithm askers:
Top JavaScript Askers - click here.
Julia's favorite 66 code review by views - click here.
20 algorithm questions - click here.
One algorithm can turn into a fun day. And also see chat room works.
Reversing k size sequence in a linked list. Code review makes perfect.
Longest palindrome string - best review - no raw loop.
Introduction
Julia found out that she had 6% performance tag next to her name, and then she felt so good after she worked on them last 48 days. So, she decided to study the ranking page, spent over one hour to find something to work on.
Study the ranking statistics:
Actionable Items:
Julia will spend some time to look into 5,000+, less than 200 people, check 10 people a time.
Julia drills down what she did from January 5 - January 10, 2017
134 reputation - Julia gain 34 reputation by posting two code reviews - one is called "Simple Function", another one is called "Find kth largest element in the union of two sorted array".
Research
Most of important, she found out the best algorithm teachers she can find, and learn from the answers.
1. score over 1122 points on JavaScript - link is here.
2. score 880 algorithm points - link is here.
3. score over algorithm 459 points - link is here.
4. score algorithm 200 points - link is palacsint.
4. Go through algorithm score ranking - link is here.
Study those top algorithm answerers:
Study those top algorithm askers:
Top JavaScript Askers - click here.
Julia's favorite 66 code review by views - click here.
20 algorithm questions - click here.
One algorithm can turn into a fun day. And also see chat room works.
Reversing k size sequence in a linked list. Code review makes perfect.
Longest palindrome string - best review - no raw loop.
Pluralsight: Encapsulation and SOLID
January 10, 2017
Introduction
Julia did some research on stackexchange.com ranking page over one hour, then she found one of talents also teaches on pluralsight.com. Last 2 - 3 months, Julia did not have taken any course. She likes to plan to study the course.
Unbelievable, Julia saw something making her smile, the first 10 days of new year 2017.
Remember the joy, and also first few algorithms she asked, people rushed to help Julia out, and help her write, think and reasoning, she learned to write her own work, first time she earned the privilege to give out up-vote, Julia found a community to get connected. Have some visual thing to help the celebration of 48 days journey.
Plan
Study the course: Encapsulation and SOLID by Mark Seemann
Introduction
Julia did some research on stackexchange.com ranking page over one hour, then she found one of talents also teaches on pluralsight.com. Last 2 - 3 months, Julia did not have taken any course. She likes to plan to study the course.
Unbelievable, Julia saw something making her smile, the first 10 days of new year 2017.
Remember the joy, and also first few algorithms she asked, people rushed to help Julia out, and help her write, think and reasoning, she learned to write her own work, first time she earned the privilege to give out up-vote, Julia found a community to get connected. Have some visual thing to help the celebration of 48 days journey.
Plan
Study the course: Encapsulation and SOLID by Mark Seemann
Sunday, January 8, 2017
Stackexchange.com code review - bonus reputation
January 8, 2016
Julia has a good news to share, she got bonus reputation 100 for code review on stackexchange.com.
Here is the snapshot of the message she got for 8 sites. She got 800 bonus reputation.
Julia has a good news to share, she got bonus reputation 100 for code review on stackexchange.com.
Here is the snapshot of the message she got for 8 sites. She got 800 bonus reputation.
Code Review: Sherlock and Anagrams
January 8, 2016
Introduction
Julia worked on the code review by one user third time, she plans to review all submissions from the same user.
Workout
First algorithm review -
Practice I
Practice II
Practice III
Practice IV
Practice V
Practice VI: Warmup after 3 months
Spent some time to go over code:
Read editorial notes, and also have some practice using C# on January 8, 2016.
Another practice using C#.
January 22, 2017
Another practice, C# code is here.
study code review done by mdfst13, review is here.
Introduction
Julia worked on the code review by one user third time, she plans to review all submissions from the same user.
Workout
First algorithm review -
Sherlock and Anagrams
Julia worked on the algorithm, here are her previous blogs about the algorithm:
Practice II
Practice III
Practice IV
Practice V
Practice VI: Warmup after 3 months
Spent some time to go over code:
Read editorial notes, and also have some practice using C# on January 8, 2016.
Another practice using C#.
January 22, 2017
Another practice, C# code is here.
study code review done by mdfst13, review is here.
Tennis coaches and their sharing of teaching
January 8, 2016
Introduction
Julia starts to show strong interest on tennis coaches study after she wrote her first post about tennis coach Rob Steckley on Dec. 26, 2016. Specially, when she experienced the nervousness to prepare a 75 minutes coding assignment and rushed to find help, she knew that sometimes she let nervousness take over, domino effect may happen, because she is still a weak player without strong disciplines and a lot of trials and errors. Algorithm player and tennis sports are two sports Julia trains herself hard.
Julia knew that she had weakness on her English skills, she has to push herself write down something every day; and also, recently, she likes to clean out the blog page content, for example, do not show link url instead of showing some interesting context, pay attention to small detail, specially after she starts to learn aesthetics in design, read the book the art of readable code (Part I. Surface-Level Improvements - chapter 4: Aesthetics); she learned a few things from stackexchange.com code review, when her posts were edited by various people.
Patrick Mouratoglou and Darren Cahill US open interview, Julia chose to study the interview again, and this time, she likes to document the coach's talk, how coaches help tennis player express the anger in the match, and how to relate to her own experience in sports and also in competition of software programming contests.
Workout
Julia has to pay attention to her English skills, and then work on small task once a while. Take down notes from the coaches, and continue to do some research.
Will spend one hour to take notes first. Will come back very soon.
1:58pm
Darren Cahill:
Former coach of Agassi & Hweitt
1988 US Open Semifinals
Current coach of Simona Halep
Simona threw the racket - how did coach guide her on releasing her anger properly?
Consistency, consistency in the training. Consistency in the game plan, then be able to evolve as a tennis player as well, not stick to one thing at all; If something is not working, you have to find other ways to win in tennis matches. At the beginning to work with Simona, if something is not working, then bring out domino effect, a lot of loss of points afterwards, affect the game. She is doing much better right now, isolate that thing, move to something working.
In perfect world, no to Simona's action to throw racket on the ground. You want the player to keep those emotions inside. But she is Romania, she has a fire in the belly. They like to express themselves, especially Simona. And my biggest issues are if you do get angry, that is fine. But do not filter through next 2, 3 points, and let games get away from you. But we just need to get her a few rackets.
Introduction
Julia starts to show strong interest on tennis coaches study after she wrote her first post about tennis coach Rob Steckley on Dec. 26, 2016. Specially, when she experienced the nervousness to prepare a 75 minutes coding assignment and rushed to find help, she knew that sometimes she let nervousness take over, domino effect may happen, because she is still a weak player without strong disciplines and a lot of trials and errors. Algorithm player and tennis sports are two sports Julia trains herself hard.
Julia knew that she had weakness on her English skills, she has to push herself write down something every day; and also, recently, she likes to clean out the blog page content, for example, do not show link url instead of showing some interesting context, pay attention to small detail, specially after she starts to learn aesthetics in design, read the book the art of readable code (Part I. Surface-Level Improvements - chapter 4: Aesthetics); she learned a few things from stackexchange.com code review, when her posts were edited by various people.
Patrick Mouratoglou and Darren Cahill US open interview, Julia chose to study the interview again, and this time, she likes to document the coach's talk, how coaches help tennis player express the anger in the match, and how to relate to her own experience in sports and also in competition of software programming contests.
Workout
Julia has to pay attention to her English skills, and then work on small task once a while. Take down notes from the coaches, and continue to do some research.
Will spend one hour to take notes first. Will come back very soon.
1:58pm
Darren Cahill:
Former coach of Agassi & Hweitt
1988 US Open Semifinals
Current coach of Simona Halep
Simona threw the racket - how did coach guide her on releasing her anger properly?
Consistency, consistency in the training. Consistency in the game plan, then be able to evolve as a tennis player as well, not stick to one thing at all; If something is not working, you have to find other ways to win in tennis matches. At the beginning to work with Simona, if something is not working, then bring out domino effect, a lot of loss of points afterwards, affect the game. She is doing much better right now, isolate that thing, move to something working.
In perfect world, no to Simona's action to throw racket on the ground. You want the player to keep those emotions inside. But she is Romania, she has a fire in the belly. They like to express themselves, especially Simona. And my biggest issues are if you do get angry, that is fine. But do not filter through next 2, 3 points, and let games get away from you. But we just need to get her a few rackets.
Code review by User (III)
January 8, 2016
Introduction
Julia woke up in the middle of the sleep, and then she checked her two posts on code review, she was amazed that in her 3 hours sleep she got 3 up-votes. Actually she went bed around 2:00am, she posted 2 algorithms for code review. What a bad unhealthy life style - let internet ruin the good sleep.
She knows that she has to learn how to play a good game about reputations, and do not let reputation take over her strong analytical mind she is trying to build up. At 9:48am the morning, her reputation is up to 189, 20 more reputation compared to 2:00am, January 8, 2017 when she went to sleep.
One of algorithms is about simple function. Link is here. She got 2 up-votes, each brings 5 reputation.
Another one is about "Find kth largest element in the union of two sorted array". Link is here. She also got 2 up-votes.
She taught herself to be very patient in Saturday, spent over 4 hours to work on Hackerearth simple function again, and learn whatever she has to do. She got feedback from her post - the code is hard to follow, where code is rewritten from her study other player's C++ code. One algorithm a time (This algorithm Julia worked on more than 2 * 10 hours). So, she likes to avoid complicated code, and work with high reputation talent (For me that solution is hard for follow – Paparazzi Jan 2 at 15:12 about Julia's post) better, she said goodbye to her old post and all her concerns to work on the follow-up post.
So, most of important is to have some sportsmanship, check other people's post, and give out an up-vote as well. Think about others, give out some encouragement as well. The small sportsmanship leads her to do a study on a post by this user.
Workout
Julia experienced the excitement from reputation going up 20 from 169 to 189, after she worked on algorithm more than 8 hours in Saturday, January 7, 2016. Now she is imaging that how much work she has to complete in order to make this reputation go up to the user - CodeYogi 1683, top 8% overall.
100 algorithm, have some time to study peers.
First algorithm review -
Practice I
Practice II
Practice III
Practice IV
Practice V
Practice VI: Warmup after 3 months
Introduction
Julia woke up in the middle of the sleep, and then she checked her two posts on code review, she was amazed that in her 3 hours sleep she got 3 up-votes. Actually she went bed around 2:00am, she posted 2 algorithms for code review. What a bad unhealthy life style - let internet ruin the good sleep.
She knows that she has to learn how to play a good game about reputations, and do not let reputation take over her strong analytical mind she is trying to build up. At 9:48am the morning, her reputation is up to 189, 20 more reputation compared to 2:00am, January 8, 2017 when she went to sleep.
One of algorithms is about simple function. Link is here. She got 2 up-votes, each brings 5 reputation.
Another one is about "Find kth largest element in the union of two sorted array". Link is here. She also got 2 up-votes.
She taught herself to be very patient in Saturday, spent over 4 hours to work on Hackerearth simple function again, and learn whatever she has to do. She got feedback from her post - the code is hard to follow, where code is rewritten from her study other player's C++ code. One algorithm a time (This algorithm Julia worked on more than 2 * 10 hours). So, she likes to avoid complicated code, and work with high reputation talent (For me that solution is hard for follow – Paparazzi Jan 2 at 15:12 about Julia's post) better, she said goodbye to her old post and all her concerns to work on the follow-up post.
So, most of important is to have some sportsmanship, check other people's post, and give out an up-vote as well. Think about others, give out some encouragement as well. The small sportsmanship leads her to do a study on a post by this user.
Workout
Julia experienced the excitement from reputation going up 20 from 169 to 189, after she worked on algorithm more than 8 hours in Saturday, January 7, 2016. Now she is imaging that how much work she has to complete in order to make this reputation go up to the user - CodeYogi 1683, top 8% overall.
100 algorithm, have some time to study peers.
First algorithm review -
Sherlock and Anagrams
Julia worked on the algorithm, here are her previous blogs about the algorithm:
Practice II
Practice III
Practice IV
Practice V
Practice VI: Warmup after 3 months
Saturday, January 7, 2017
Facebook hackercup qualification round - Fighting the Zombie
January 7, 2017
Julia likes to get some experience on this - she likes to have some adventure for 2017.
Julia likes to get some experience on this - she likes to have some adventure for 2017.
- Online Qualification Round: January 6, 2017, 4pm PST - January 9, 2017, 4pm PST (72 hours)
Here is the link to get some experience.
The progress pie - the third algorithm.
Plan to spend as many hours as I can this weekend. Enjoy the qualification round.
The progress pie - the third algorithm.
Plan to spend as many hours as I can this weekend. Enjoy the qualification round.
Facebook hackercup qualification round - lazy loading
January 7, 2017
Julia likes to get some experience on this - she likes to have some adventure for 2017.
Julia likes to get some experience on this - she likes to have some adventure for 2017.
- Online Qualification Round: January 6, 2017, 4pm PST - January 9, 2017, 4pm PST (72 hours)
Here is the link to get some experience.
The progress pie - the second algorithm.
Plan to spend as many hours as I can this weekend. Enjoy the qualification round.
The progress pie - the second algorithm.
Plan to spend as many hours as I can this weekend. Enjoy the qualification round.
Friday, January 6, 2017
Exercise and the brain
January 6, 2017
Watch the video by Wendy Suzuki - a professor of New York university.
http://www.wendysuzuki.com/
Watch the video by Wendy Suzuki - a professor of New York university.
http://www.wendysuzuki.com/
Facebook Hacker Cup 2017 - The progress pie
January 6, 2017
Julia likes to get some experience on this - she likes to have some adventure for 2017.
Julia likes to get some experience on this - she likes to have some adventure for 2017.
- Online Qualification Round: January 6, 2017, 4pm PST - January 9, 2017, 4pm PST (72 hours)
Here is the link to get some experience.
The progress pie - the first algorithm.
Plan to spend as many hours as I can this weekend. Enjoy the qualification round.
The progress pie - the first algorithm.
Plan to spend as many hours as I can this weekend. Enjoy the qualification round.
Trust your struggle
January 6, 2016
Trust your struggle - Zain Asher - CNN Anchor, a very nice and well-prepared talk around 14 minutes.
Zain Asher Bio is here.
3 beliefs:
1. Hard work is not all. Trust your struggle. The hardship you go through will be your own benefit.
2. Not believe competing what you want, but creating what you want. Do not need to take anything from others.
Abraham Lincoln: The best way to predict your future is to create it.
Instead of competing, compare yourself again and again, actually bring out fear, insecurity and actually hold you back.
3. The more you give, the more you receive.
Interview Kat Cole, is something different: The more you give, the more you receive.
You have to network, have a brand, and study your competition.
Loosely related to hard work, success comes when opportunity meets preparation.
Her brother is an actor - master to prepare early, very well.
Trust one day, the opportunity will come. Not prepare for interview.
Teach herself about stock, finance, a few years. After she prepared for financial study for a few years, she had chance of 2 weeks to prepare for the screen test and financial test, for a position of finance reporter in CNN.
Trust your struggle - Zain Asher - CNN Anchor, a very nice and well-prepared talk around 14 minutes.
Zain Asher Bio is here.
3 beliefs:
1. Hard work is not all. Trust your struggle. The hardship you go through will be your own benefit.
2. Not believe competing what you want, but creating what you want. Do not need to take anything from others.
Abraham Lincoln: The best way to predict your future is to create it.
Instead of competing, compare yourself again and again, actually bring out fear, insecurity and actually hold you back.
3. The more you give, the more you receive.
Interview Kat Cole, is something different: The more you give, the more you receive.
You have to network, have a brand, and study your competition.
Loosely related to hard work, success comes when opportunity meets preparation.
Her brother is an actor - master to prepare early, very well.
Trust one day, the opportunity will come. Not prepare for interview.
Teach herself about stock, finance, a few years. After she prepared for financial study for a few years, she had chance of 2 weeks to prepare for the screen test and financial test, for a position of finance reporter in CNN.
Thursday, January 5, 2017
8 Do not - Relax and Be Yourself
January 5, 2016
Be yourself and relax in 2017. It will be a great year for hard working people, Julia, you are one of them.
A - Do not act like you know everything. (I am still learning, do one thing a time.)
B - Do not be a hero. (I make mistakes, and then know how to calculate the risk better)
B - Do not be overly format. (Specially, do not purchase too many clothes.)
O - Do not over-prepare. (Treat yourself as a human being. Stay in the moment. )
P - Do not panic if a problem stumps you. (Nobody is perfect. Even champions will fail over and over again.)
S - Do not second-guess yourself. (Practice makes perfect. Do one thing a time)
S - Do not stress if you are not a 10X coder. (Julia, you fail so many times in programming contests, then you learn the difficulty of problem solving.)
Review the interview cheat sheet blog's notes, write down most favorite ones:
1. Don't be overly format. "Don't act like somebody you're not - it's really a come-as-you-are environment."
2. Don't second-guess yourself. "You have to have confidence in your ability to make connections, because executives are going to challenging your recommendations. You'll be expected to back them up."
3. Don't act like you know everything.
4. Don't stress if you're not a 10X coder.
5. "The interview isn't grading you on your improv skills, but whether you steer difficult conversations forward without falling for distraction."
6. Don't be a hero. "Be able to articulate your specific contributions instead of doing everything yourself."
7. Don't over-prepare. "Planning everything you're going to say and do in the case study portion of the interview makes for a stale presentation and misses the mark. The point of the case is to see how you approach problems in real time."
8. Don't panic if a problem stumps you. "We're really trying to assess your thought process, so if you get stuck or make a mistake, don't stress out - nobody is perfect."
Be yourself and relax in 2017. It will be a great year for hard working people, Julia, you are one of them.
A - Do not act like you know everything. (I am still learning, do one thing a time.)
B - Do not be a hero. (I make mistakes, and then know how to calculate the risk better)
B - Do not be overly format. (Specially, do not purchase too many clothes.)
O - Do not over-prepare. (Treat yourself as a human being. Stay in the moment. )
P - Do not panic if a problem stumps you. (Nobody is perfect. Even champions will fail over and over again.)
S - Do not second-guess yourself. (Practice makes perfect. Do one thing a time)
S - Do not stress if you are not a 10X coder. (Julia, you fail so many times in programming contests, then you learn the difficulty of problem solving.)
Review the interview cheat sheet blog's notes, write down most favorite ones:
1. Don't be overly format. "Don't act like somebody you're not - it's really a come-as-you-are environment."
2. Don't second-guess yourself. "You have to have confidence in your ability to make connections, because executives are going to challenging your recommendations. You'll be expected to back them up."
3. Don't act like you know everything.
4. Don't stress if you're not a 10X coder.
5. "The interview isn't grading you on your improv skills, but whether you steer difficult conversations forward without falling for distraction."
6. Don't be a hero. "Be able to articulate your specific contributions instead of doing everything yourself."
7. Don't over-prepare. "Planning everything you're going to say and do in the case study portion of the interview makes for a stale presentation and misses the mark. The point of the case is to see how you approach problems in real time."
8. Don't panic if a problem stumps you. "We're really trying to assess your thought process, so if you get stuck or make a mistake, don't stress out - nobody is perfect."
The kth largest element from two sorted arrays
January 5, 2017
Introduction
Spent over 2 hours to study Leetcode 4 and Leetcode 215: the medium of two sorted array, and then Leetcode 215: the kth largest element from the array, and then, Julia spent over one hour to work on the code for the algorithm: the kth largest element from two sorted array.
Workout
Here is the C# practice: binary search, time complexity: not O(lg n + lg m), smaller one: O(lg(n+m)), n, m are the length of two sorted arrays.
Julia likes to work on the test case a little more time, 20 - 30 minutes, and then post the algorithm on stackexchange.com for a code review.
Read the article again, learn more about the analysis.
January 9, 2017
The most important feedback about the code - code review:
Just so you know, your solution appears to beO(logk∗(n+m)) . The reason is that O(n) or O(m) time. If you would just avoid doing the copy and instead pass a starting index for each array to your function, you would be down to O(logk) time. – JS1
Actionable Items:
1. Read a few articles about the algorithm, list here:
2. Write a new version of algorithm to solve all issues, post it on code review. Learn by doing.
3. C# practice with the correction of time complexity issue - array splice. Code is here.
Introduction
Spent over 2 hours to study Leetcode 4 and Leetcode 215: the medium of two sorted array, and then Leetcode 215: the kth largest element from the array, and then, Julia spent over one hour to work on the code for the algorithm: the kth largest element from two sorted array.
Workout
Here is the C# practice: binary search, time complexity: not O(lg n + lg m), smaller one: O(lg(n+m)), n, m are the length of two sorted arrays.
Julia likes to work on the test case a little more time, 20 - 30 minutes, and then post the algorithm on stackexchange.com for a code review.
Read the article again, learn more about the analysis.
January 9, 2017
The most important feedback about the code - code review:
Just so you know, your solution appears to be
ArraySplice() makes a copy of the array, which takes either Actionable Items:
1. Read a few articles about the algorithm, list here:
2. Write a new version of algorithm to solve all issues, post it on code review. Learn by doing.
3. C# practice with the correction of time complexity issue - array splice. Code is here.
Code review by user (II)
January 5, 2016
Review all 65 question asked by one user.
Leetcode 215 Julia's C# practice
Review all 65 question asked by one user.
1. Buy once and sell once for maximum profit
solutions for 3 algorithms: once, twice, or at most twice
Leetcode 223 rectangle area - solution with a graph
3. Find median of two sorted arrays
Review the blog written in 2015, and one in 2016.
3. Find median of two sorted arrays
Review the blog written in 2015, and one in 2016.
Leetcode 215 Julia's C# practice
Code Review: Social network broadcast message algorithm
Code Review: Minimum Spanning Tree
January 5, 2017
Review minimum spanning tree
Minimum Spanning Tree using Prim's algorithm
Look into those reviews: very good advice about global variable.
Wednesday, January 4, 2017
Leetcode 333: Largest BST subtree
Leetcode 210: Course Schedule (II)
January 4, 2016
Review Leetcode 210.
Study the solution here first.
Review previous practice here.
Just warm up graph algorithm in 30 minutes:
Study graph on code review website on stackexchange.com.
Review Leetcode 210.
Study the solution here first.
Review previous practice here.
Just warm up graph algorithm in 30 minutes:
Study graph on code review website on stackexchange.com.
- First review of BFS, DFS - Excellent review link is here.
- Implementation of Graph - Good review link is here.
Implementation of Dijkstra's algorithm
Good lecture about test driven development
Monday, January 2, 2017
Algorithm study
January 2, 2017
Plan to spend some time to go over the algorithms one by one.
Go over those algorithm first:
K Closest Points
Longest Palindrome
Rectangle Overlap
Window Sum
Copy List with Random Pointer
Five Scores
Maximum Subtree
Minimum Spanning Tree
Order Dependency
Plan to spend some time to go over the algorithms one by one.
Go over those algorithm first:
K Closest Points
Longest Palindrome
Rectangle Overlap
Window Sum
Copy List with Random Pointer
Five Scores
Maximum Subtree
Minimum Spanning Tree
Order Dependency
Coding Questions:
ALeetcode 240: Search a 2D Matrix
January 2, 2017
Problem statement
Introduction
Study the code written in two solutions, first one is time complexity O(log(m*n)) using binary search and second one using binary search is O(logm + logn).
Workout
Study C++ code first.
Problem statement
Introduction
Study the code written in two solutions, first one is time complexity O(log(m*n)) using binary search and second one using binary search is O(logm + logn).
Workout
Study C++ code first.
Matrix Rotation Study
January 2, 2017
Introduction
Julia learns the hard way. This past 2016, Julia worked on matrix rotation practice (No.1) again in April, 2016, she failed to deliver the ideal result in one hour setting. And then, she came back to work on matrix rotation so many times. Hackonacci Matrix rotation - algorithm on HackerRank week code 27, Julia spent more than 4 hours to review all submissions, she did learn the hard way - in the contest she spent more than 3 hours to write code, but scored less than 10% in Dec. 2016.
Now, she came cross this study about using transpose and flip code again, now she was smart and mature enough to take it and be the master of matrix rotation time saver.
Workout
Use transpose and flip operations
Another code of transpose and flip with a flag to separate clockwise from anti-clockwise.
Julia's C# practice.
Introduction
Julia learns the hard way. This past 2016, Julia worked on matrix rotation practice (No.1) again in April, 2016, she failed to deliver the ideal result in one hour setting. And then, she came back to work on matrix rotation so many times. Hackonacci Matrix rotation - algorithm on HackerRank week code 27, Julia spent more than 4 hours to review all submissions, she did learn the hard way - in the contest she spent more than 3 hours to write code, but scored less than 10% in Dec. 2016.
Now, she came cross this study about using transpose and flip code again, now she was smart and mature enough to take it and be the master of matrix rotation time saver.
Workout
Use transpose and flip operations
Another code of transpose and flip with a flag to separate clockwise from anti-clockwise.
Julia's C# practice.
Sunday, January 1, 2017
Hackerrank - Ad Infinitum 17
January 1, 2016
Julia likes to get more experience to play contest, she is very busy on January 1, but she likes to spend 2 - 3 hours to work on the contest, and get some experience.
Focus on reading, be able to understand the algorithm, improve her English reading, solve problems quickly.
Will come back very soon.
Julia likes to get more experience to play contest, she is very busy on January 1, but she likes to spend 2 - 3 hours to work on the contest, and get some experience.
Focus on reading, be able to understand the algorithm, improve her English reading, solve problems quickly.
Will come back very soon.
2017 New Year's day - Code Review: Connected Cell in a Grid
January 1, 2017
Ask questions on code review.
Connected Cell in a Grid - Warm up with Five Practices
Spent 2+ hour to put together C# code to post a review request.
Ask ideas how to add some debug code to track quickly/ efficiently the design:
1. Queue - in/ out as designed
2. Connected Region - counting of cells is correct
3. Check how many regions are counted
4. Basically, talking about tips to help development of code, not affect the presentation of code.
Here is the code review feedback:
boundary check and user input handling
Ask questions on code review.
Connected Cell in a Grid - Warm up with Five Practices
Spent 2+ hour to put together C# code to post a review request.
Ask ideas how to add some debug code to track quickly/ efficiently the design:
1. Queue - in/ out as designed
2. Connected Region - counting of cells is correct
3. Check how many regions are counted
4. Basically, talking about tips to help development of code, not affect the presentation of code.
Here is the code review feedback:
boundary check and user input handling
Hackerearth "January Easy '17 contest" Simple Function
January 1, 2017
Plan to attend 8:00 - 11:00am hackerearth.com
January Easy '17 contest
Work on the algorithm:
January Clash '2017
- One of 6 algorithms: Simple Function
In contest performance, C# solution, pass test case 1, but timeout all other cases. (9:00am - 11:00am)
C# solution, passed 5 test cases, fail last one. (after the contest, 2+ hours)
Study code C++
Write C# code using the above solution. (Time spent: 4 + hours, completed at 6:37pm)
Code Review Link is here. Julia spent more than one hour on January 3, 2016 to add her calculation of cache size reduction from 2MB to 80KB based on the comment from Paparazzi
January 7, 2016
Continue to do some research on C# Dictionary comparison to self-defined hash function to do pre-processing.
Using Dictionary<string, int>
C# with Dictionary code:
Test result from hackerearth.com:
The time complexity analysis:
function CalculateSumOfEvenNumbers(), inside two loops, function GetLastDigit(...)
is called; inside GetLastDigit() function, there is a HashSet to prevent
duplicate calculation, and then, GetLastDigit() is called; inside GetLastDigit(),
two calls of the function GetDigits(). Actually, we only care about two integer
number, biggest same digit, and we do not care about how many digit inside
each integer. And this approach goes over each digit in the integer.
Self-defined hash function
Comparison to the self-defined hash function - code is here:
The performance:
Time analysis:
For each query, process two baskets of integers, two separate loops, O(N1 + N2), detail see function ProcessInput(...); For each number, call Hash function to process, any number is at most 4 digits, each digit, only do one calculation to determine the digit from 1 to 9. Just a minus arithmetic calculation. Detail see the function Hash(char[] cache, int nthNumber, int serialNo)
To calculate the even number count, call function CheckNumberIsEven(...) N1 * N2 times, each function call, only need to look up at most 10 times, find a match then break the loop.
So, overall, time complexity is O(N1+N2) + O( N1*N2), is around O(10^6) calculation of CheckNumberIsEven function which includes a few of arithmetic calculations; the self-defined hash function is almost less than 1 percent of time to compare calculation the even number count.
Digits Internal Class
Another C# version, no Dictionary, just use int[10] to store an integer, with digits. No string manipulation to get the substring. Pass all test cases. Code is here.
Performance:
HashedInteger Class
Digits class name is not very meaningful, so HashedInteger class name is chosen to replace Digits.
And also Save API is not clear, add Convert, ConvertAll APIs instead.
The code is here.
Plan to attend 8:00 - 11:00am hackerearth.com
January Easy '17 contest
Work on the algorithm:
January Clash '2017
- One of 6 algorithms: Simple Function
In contest performance, C# solution, pass test case 1, but timeout all other cases. (9:00am - 11:00am)
C# solution, passed 5 test cases, fail last one. (after the contest, 2+ hours)
Study code C++
Write C# code using the above solution. (Time spent: 4 + hours, completed at 6:37pm)
Code Review Link is here. Julia spent more than one hour on January 3, 2016 to add her calculation of cache size reduction from 2MB to 80KB based on the comment from Paparazzi
January 7, 2016
Continue to do some research on C# Dictionary comparison to self-defined hash function to do pre-processing.
Using Dictionary<string, int>
C# with Dictionary code:
Test result from hackerearth.com:
The time complexity analysis:
function CalculateSumOfEvenNumbers(), inside two loops, function GetLastDigit(...)
is called; inside GetLastDigit() function, there is a HashSet to prevent
duplicate calculation, and then, GetLastDigit() is called; inside GetLastDigit(),
two calls of the function GetDigits(). Actually, we only care about two integer
number, biggest same digit, and we do not care about how many digit inside
each integer. And this approach goes over each digit in the integer.
Self-defined hash function
Comparison to the self-defined hash function - code is here:
The performance:
Time analysis:
For each query, process two baskets of integers, two separate loops, O(N1 + N2), detail see function ProcessInput(...); For each number, call Hash function to process, any number is at most 4 digits, each digit, only do one calculation to determine the digit from 1 to 9. Just a minus arithmetic calculation. Detail see the function Hash(char[] cache, int nthNumber, int serialNo)
To calculate the even number count, call function CheckNumberIsEven(...) N1 * N2 times, each function call, only need to look up at most 10 times, find a match then break the loop.
So, overall, time complexity is O(N1+N2) + O( N1*N2), is around O(10^6) calculation of CheckNumberIsEven function which includes a few of arithmetic calculations; the self-defined hash function is almost less than 1 percent of time to compare calculation the even number count.
Digits Internal Class
Another C# version, no Dictionary, just use int[10] to store an integer, with digits. No string manipulation to get the substring. Pass all test cases. Code is here.
Performance:
HashedInteger Class
Digits class name is not very meaningful, so HashedInteger class name is chosen to replace Digits.
And also Save API is not clear, add Convert, ConvertAll APIs instead.
The code is here.
Subscribe to:
Posts (Atom)









