Here is the link.
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, December 30, 2020
Intc stock: Equity research - I like to build wealth on INTC equity research
Dec. 30, 2020
Introduction
It is most important job to read about how to invest. My daily task is to read all articles I can find about INTC stock. I need to start to think about purchase 500 shares of INTC and learn how to be a value investor.
My notes
- INTC stock - The past month 0.34% loss
- 4.54% the computer and technology sector's gain - Need to invest on technology sector
- 2.59% gain - S&P 500
- Next earning release - Prepare early - buy shares of INTC stock - post earnings $1.10/ share, decline 27.63% year over year
- $17.44 billion, down 13.7% - year-ago period
- INTC - Sell ranking
- Forward P/ E ratio 10.1, industry average is 29.47
- NTC's PEG ratio is currently 1.35, average industry of semi-conduct is 3.04
Zacks Equity Research
Intel (INTC) closed the most recent trading day at $48.75, moving -1.3% from the previous trading session. This change lagged the S&P 500's 0.13% gain on the day. At the same time, the Dow added 0.24%, and the tech-heavy Nasdaq gained 0.15%.
Prior to today's trading, shares of the world's largest chipmaker had lost 0.34% over the past month. This has lagged the Computer and Technology sector's gain of 4.54% and the S&P 500's gain of 2.59% in that time.
Investors will be hoping for strength from INTC as it approaches its next earnings release. In that report, analysts expect INTC to post earnings of $1.10 per share. This would mark a year-over-year decline of 27.63%. Meanwhile, the Zacks Consensus Estimate for revenue is projecting net sales of $17.44 billion, down 13.7% from the year-ago period.
INTC's full-year Zacks Consensus Estimates are calling for earnings of $4.89 per share and revenue of $75.33 billion. These results would represent year-over-year changes of +0.41% and +4.67%, respectively.
Investors might also notice recent changes to analyst estimates for INTC. These recent revisions tend to reflect the evolving nature of short-term business trends. As such, positive estimate revisions reflect analyst optimism about the company's business and profitability.
Based on our research, we believe these estimate revisions are directly related to near-team stock moves. We developed the Zacks Rank to capitalize on this phenomenon. Our system takes these estimate changes into account and delivers a clear, actionable rating model.
Ranging from #1 (Strong Buy) to #5 (Strong Sell), the Zacks Rank system has a proven, outside-audited track record of outperformance, with #1 stocks returning an average of +25% annually since 1988. Over the past month, the Zacks Consensus EPS estimate remained stagnant. INTC is currently a Zacks Rank #4 (Sell).
Digging into valuation, INTC currently has a Forward P/E ratio of 10.1. This represents a discount compared to its industry's average Forward P/E of 29.47.
Meanwhile, INTC's PEG ratio is currently 1.35. The PEG ratio is similar to the widely-used P/E ratio, but this metric also takes the company's expected earnings growth rate into account. The Semiconductor - General was holding an average PEG ratio of 3.04 at yesterday's closing price.
The Semiconductor - General industry is part of the Computer and Technology sector. This industry currently has a Zacks Industry Rank of 232, which puts it in the bottom 10% of all 250+ industries.
The Zacks Industry Rank gauges the strength of our individual industry groups by measuring the average Zacks Rank of the individual stocks within the groups. Our research shows that the top 50% rated industries outperform the bottom half by a factor of 2 to 1.
To follow INTC in the coming trading sessions, be sure to utilize Zacks.com.
5 Ways to Manage Your MONEY Like the RICH
Here is the link.
- The biggest difference is mindset
- Focus on building income producing assets
- Key take-away #3 Use an LLC for asset protection to limit exposure to liability
- Be active in the way money is managed and think about the investments being made. Use personal networks to source knowledge and expertise for better opportunities and consider investing collectively with others
- Currencies throughout the world are subject to free floating exchange between countries which are complicated to understand and are exposed to punishing circumstances. Direct portions of earnings into investments independent of the impacts of inflation, such as bank savings, and into investments with actual economy utility such as real estate
Leetcode dsicuss: Leetcode 600 questions beyond - strategies and tips
Here is the link.
Dec. 30, 2020
I like to get advice how to advance my problem solving skills by practicing Leetcode algorithm.
I solved over 180 algorithms in 2020 to prepare for Facebook onsite (August) and Google onsite (December), in total I solved 605 algorithms (243 Easy/ 289 Medium/ 73 Hard). After Google phone screen, I paid for Leetcode annual premium to prepare Google onsite in Oct. 2020, I finished 14 set of Google mock onsite interviews.
I like to get advice how to improve my problem solving skills. Here are my plan in 2021:
- Solve all Leetcode premium Facebook, Amazon, Google, Microsoft mock onsite interview questions;
- Solve all Google last 6 months common asked hard/ medium level algorithms;
- Follow common asked algorithms from those companies, make sure that I can see the improvements through my practice.
Here are a few Leetcode discuss posts written by me in 2020 I like to share.
- 1368. Minimum Cost to Make at Least One Valid Path in a Grid - hard level
- 1631. Path With Minimum Effort
- 1231. Divide Chocolate
- 1293. Shortest Path in a Grid with Obstacles Elimination
- 552. Student Attendance Record II
- 378. Kth Smallest Element in a Sorted Matrix
My favorite discussion posts related to tree and other topics:
- 687. Longest Univalue Path
- 236. Lowest Common Ancestor of a Binary Tree
- 889. Construct Binary Tree from Preorder and Postorder Traversal
I enjoyed most in 2020 to go over all those links related to dynamic programming. I really enjoyed the learning how to solve dynamic programming algorithms.
Important and Useful links from all over the LeetCode
My most favorite reading to prepare for Google onsite
Nov. 27, 2020
Google | New Grad L3 [ Pending ]
Helpful Channels by Rank [According to me] :
Back To Back SWE ( Best one for everything )
Abdul Bari ( Very good, when it comes to learning new Data Structures )
WilliamFiset ( Very Good for learning Graph problems )
Kevin Naughton Jr. ( Good for random medium problems. Does not always solve the most effecient way, but it is good enough )
Nick White ( Same as the above )
happygirlzt ( Solves a lot of hard problems. Even if you don't understand her soll, if you watch her code you can figure out yourself )
Toughest bug I wrote and hard to fix by myself
If you are the expert on Leetcode, you know where I am in terms of weakness. I still find myself to struggle on small details here and there.
My hobby
I really love to practice hard level algorithms, and I also like to explore different ideas from top players, and then copy idea and write C# practice in less than 15 or 20 minutes for those hard level algorithms. My favorite players are Lee215 and a few others. When I have free time, I always like to try some new ideas, specially hard level, try at least three top voted discuss posts, and I really like to advance my C# coding skills.
85 - Maximal Rectangle
(Second practice - C# - Curiosity - Study and learn - 84 Largest histogram
84 - largest rectangle in histogram
C# Showcase how to solve the problem starting from 2015
How to analyze the problem starting from brute force solution?
It takes a few years to learn those two hard level algorithms 84 and 85. I think that one of practical approaches is to write at least three solutions just by copying ideas and code, convert it to my own language choice first. One of ideas I tried is to work on a simple test case, explain to myself using the test case, build confidence by solving this simple test case first, and later if I have time, then I can add some edge cases discussion.
Mathmatics is my hobby. Security and cryptograhpy is my favorite courses in my academic learning experience. I really like to advance my research skills, I think that Leetcode algorithm practice will help me to improve my research talent.
Please share your tips and strategies if you have 5 to 10 minutes, your favorite top players on Leetcode, who to learn from ideas and coding from Leetcode discuss post.
Happy new year 2021 and great success for everyone in 2021.
Where do the rich store their wealth...
Here is the link.
To take the Ken's financial stress test follow this link: https://kenmcelroy.com/stresstest/ Join Ken as he walks through a basic understanding of where the rich store their wealth. Be sure to click the bell to be notified as soon as the next video is posted.
CHS stock: My homework
11 Consumer Discretionary Stocks Moving In Monday's Intraday Session
Gainers
- Chico's FAS (NYSE:CHS) stock rose 20.8% to $1.8 during Monday's regular session. As of 12:31 EST, Chico's FAS's stock is trading at a volume of 2.6 million, which is 149.29% of its average full-day volume over the last 100 days. The market value of their outstanding shares is at $215.8 million.
- 500.com (NYSE:WBAI) stock rose 20.27% to $5.16. The current volume of 935.4K shares is 113.14% of 500.com's average full-day volume over the last 100 days (last updated at 12:31 EST). The company's market cap stands at $221.8 million.
- Ark Restaurants (NASDAQ:ARKR) shares rose 15.59% to $19.77. Trading volume for this security as of 12:31 EST is 80.8K, which is 260.09% of its average full-day volume over the last 100 days. The market value of their outstanding shares is at $69.2 million.
- Good Times Restaurants (NASDAQ:GTIM) stock moved upwards by 12.4% to $3.08. Good Times Restaurants's stock is trading at a volume of 143.5K shares as of 12:31 EST. This is 267.33% of its average full-day volume over the last 100 days. The company's market cap stands at $38.8 million.
- Macy's (NYSE:M) stock increased by 10.73% to $11.9. The current volume of 23.3 million shares is 87.95% of Macy's's average full-day volume over the last 100 days (last updated at 12:31 EST). The market value of their outstanding shares is at $3.6 billion.
Losers
- MINISO Group Holding (NYSE:MNSO) shares decreased by 20.46% to $24.69 during Monday's regular session. As of 12:31 EST, MINISO Group Holding's stock is trading at a volume of 2.0 million, which is 155.27% of its average full-day volume over the last 100 days. The market value of their outstanding shares is at $7.5 billion.
- Elys Game Technology (NASDAQ:ELYS) shares decreased by 11.32% to $5.72. Trading volume for this security as of 12:31 EST is 1.9 million, which is 74.29% of its average full-day volume over the last 100 days. The company's market cap stands at $95.5 million.
- Chewy (NYSE:CHWY) stock declined by 9.37% to $94.27. Trading volume for Chewy's stock is 4.2 million as of 12:31 EST. This is 100.41% of its average full-day volume over the last 100 days. The market value of their outstanding shares is at $38.9 billion.
- MOGU (NYSE:MOGU) stock declined by 8.49% to $2.27. As of 12:31 EST, MOGU's stock is trading at a volume of 326.3K, which is 128.53% of its average full-day volume over the last 100 days. The company's market cap stands at $245.6 million.
- Wunong Net Technology Co (NASDAQ:WNW) shares declined by 8.34% to $41.26. Wunong Net Technology Co's stock is trading at a volume of 99.1K shares as of 12:31 EST. This is 6.31% of its average full-day volume over the last 100 days.
- Blue Apron Hldgs (NYSE:APRN) stock fell 8.11% to $6.01. As of 12:31 EST, this security is trading at a volume of 610.9K shares, making up 74.1% of its average full-day volume over the last 100 days. The market value of their outstanding shares is at $106.2 million.
Tuesday, December 29, 2020
DON'T Buy a Home Now - 5 Reasons Why You Shouldn't
Here is the link.
Don't buy real estate now - 5 reasons why
- High demand, low supply => Home enter the market with a very high $$$
- Low supply => "Bidding wars"
- Cash is king - not even that can save you!
- Mortgage servicer migration => anticipation of foreclosures / foreclosures
- We are already in a bubble
2021 Housing Crash Response to MeetKevin
Here is the link.
- Mortgage bank association - great resource to watch
- Mortgage - 90 days past due - 1.8 million
Those five things to pay attention to in next 12 months
- ?
- Evictions are a real thing -
- Watch mortgage default
- Migration pattern -
- Take a look at business closures
Two hours coding: Day one | Leetcode premium
Dec. 29, 2020
Introduction
It is very good workout to work on one set of Leetcode premium Facebook onsite interview. I like to work on a short research - three hours a day coding, 7 benefits to work on coding, 1 hour vs 2 hour vs 3 hours.
Mock interview
I have one hour 30 minutes to work on three algorithms. I think that it is challenge for me to work on today.
I had some issues on second algorithm, and then I had some issues on third algorithm.
If I do not work on mock interview
I will not learn how to solve problems quickly in less than 90 minutes. Today I did not solve three algorithms in 90 minutes. Ideally I should be able to solve all of them, in less than 60 minutes.
The first I forgot to submit the working solution. The first submission was timeout.
The third algorithm had a bug, but I could not figure out in the mock interview.
Low 5%
Leetcode discuss: 1123. Lowest Common Ancestor of Deepest Leaves
Here is the link.
Second practice - C# - Height of Tree - Map - Array
Dec. 29, 2020
Introduction
It is easy to calculate the height of tree, and since all nodes in the tree have unique value, it is also practical to save all node's parent in an integer array, and also define a hashmap to map integer value to TreeNode.
My solution
I wrote a solution to calculate the height of tree, and then record each node's parent value in an integer array, and also a hashmap to map value to TreeNode.
For all leaf nodes, it is easy to determine by the height of node. Save all leaf nodes into a hashset. Next it is to find lowest common ancestor based on hashset.
Since all leaf nodes have same height, it is easy to go up one level, if there is only one parent, then it is LCA. Otherwise continue one more level up.
/**
* Definition for a binary tree node.
* public class TreeNode {
* public int val;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int val=0, TreeNode left=null, TreeNode right=null) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
public class Solution {
public TreeNode LcaDeepestLeaves(TreeNode root)
{
if (root == null)
return null;
var height = calculateHeightOfTree(root);
var map = new Dictionary<int, TreeNode>();
var leafNodes = new HashSet<int>();
var parents = new int[1001];
for (int i = 0; i < 1001; i++)
{
parents[i] = -1;
}
runPostOrder(map, null, root, 0, leafNodes, parents, height);
while (leafNodes.Count > 1)
{
var parentNodes = new HashSet<int>();
var list = leafNodes.ToList();
foreach(var item in list)
{
parentNodes.Add(parents[item]);
}
// next iteration
leafNodes = parentNodes;
}
return map[leafNodes.ToList()[0]];
}
private static void runPostOrder(Dictionary<int, TreeNode> map, TreeNode parent, TreeNode root,
int level, HashSet<int> leafNodes, int[] parents, int height)
{
if (root == null)
return;
map.Add(root.val, root);
if (parent != null)
{
parents[root.val] = parent.val;
}
if (level + 1 == height)
{
leafNodes.Add(root.val);
}
runPostOrder(map, root, root.left, level + 1, leafNodes, parents, height);
runPostOrder(map, root, root.right, level + 1, leafNodes, parents, height);
}
private static int calculateHeightOfTree(TreeNode root)
{
if (root == null)
return 0;
return Math.Max(calculateHeightOfTree(root.left) + 1, calculateHeightOfTree(root.right) + 1);
}
}
Leetcode discuss: 438. Find All Anagrams in a String
Here is the link.
Second practice - C# - Linear time - Counting sort
Dec. 29, 2020
Introduction
My first practice ran into time out problem since the sorting is applied. I read the problem statement again and then decide to use counting sort with linear time, the problem is solved.
Edge case
I ran into the wrong answer, so that I figured out that extra checking is needed in the function isAnagram.
if(count[item - 'a'] < 1 )
{
return false;
}
20 days break
I just took 20 days break after Dec. 8. It is surprising to learn from my two mistakes I had in my practice.
public class Solution {
public IList<int> FindAnagrams(string s, string p) {
if(s == null || p == null || s.Length == 0 || p.Length == 0 || s.Length < p.Length)
return new List<int>();
var sLength = s.Length;
var pLength = p.Length;
var list = new List<int>();
for(int i = 0; i < sLength && i + pLength <= sLength; i++)
{
var substring = s.Substring(i, pLength);
if(isAnagram(substring, p))
{
list.Add(i);
}
}
return list;
}
private bool isAnagram(string s, string t)
{
var count = new int[26];
foreach(var item in s)
{
count[item - 'a']++;
}
foreach(var item in t)
{
if(count[item - 'a'] < 1 )
{
return false;
}
count[item - 'a']--;
}
return count.Sum() == 0;
}
}
Leetcode discuss: 438. Find All Anagrams in a String
Here is the link.
TLE error - C# - First try - Reading skills
Dec. 29, 2020
Introduction
It is important to train myself to read very well. There is timeout issue if O(NlogN) sorting algorithm is applied to a string.
The string is given with the constaint "Strings consists of lowercase English letters only and the length of both strings s and p will not be larger than 20,100.". It can take O(N) time to determine if a string is anagram of another string. N is 20,100, NlgN will be around 80,000. This should be a warning number to avoid timeout.
The following code has TLE problem. This is my first try in my mock interview on premium version.
Time complexity:
O(N*M*logM), N is length of string s, M is length of P
The solution is not working, the time complexity should be O(N*M).
public class Solution {
public IList<int> FindAnagrams(string s, string p) {
if(s == null || p == null || s.Length == 0 || p.Length == 0 || s.Length < p.Length)
return new List<int>();
var sLength = s.Length;
var pLength = p.Length;
var list = new List<int>();
if(sLength == pLength && s.CompareTo(p) == 0)
{
list.Add(0);
return list;
}
var pArray = p.ToCharArray();
Array.Sort(pArray);
var sortedP = new string(pArray);
var found = new HashSet<string>();
for(int i = 0; i < sLength && i + pLength <= sLength; i++)
{
var substring = s.Substring(i, pLength);
var addToList = false;
if(found.Contains(substring))
{
addToList = true;
}
else
{
var array = substring.ToCharArray();
Array.Sort(array);
var sorted = new string(array);
if(sorted.CompareTo(sortedP) == 0)
{
addToList = true;
}
}
if(addToList)
{
list.Add(i);
found.Add(substring);
}
}
return list;
}
}
Leetcode discuss: 416. Partition Equal Subset Sum
Here is the link.
Second practice - C# - Next round - avoid adding more than once
Dec. 29, 2020
Introduction
I wrote a solution but failed at next to last test case. I debugged the code and then figured out that same number in the array is added more than once. After my first failed practice, I started to work on bug fix.
Failed test case
var test = new int[] { 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 16, 16, 16, 16, 20, 20, 20, 20, 20, 20, 20, 20, 24, 24, 24, 24, 24, 24, 24, 24, 28, 28, 28, 28, 28, 28, 28, 28, 32, 32, 32, 32, 32, 32, 32, 32, 36, 36, 36, 36, 36, 36, 36, 36, 40, 40, 40, 40, 40, 40, 40, 40, 44, 44, 44, 44, 44, 44, 44, 44, 48, 48, 48, 48, 48, 48, 48, 48, 52, 52, 52, 52, 52, 52, 52, 52, 56, 56, 56, 56, 56, 56, 56, 56, 60, 60, 60, 60, 60, 60, 60, 60, 64, 64, 64, 64, 64, 64, 64, 64, 68, 68, 68, 68, 68, 68, 68, 68, 72, 72, 72, 72, 72, 72, 72, 72, 76, 76, 76, 76, 76, 76, 76, 76, 80, 80, 80, 80, 80, 80, 80, 80, 84, 84, 84, 84, 84, 84, 84, 84, 88, 88, 88, 88, 88, 88, 88, 88, 92, 92, 92, 92, 92, 92, 92, 92, 96, 96, 96, 96, 96, 96, 96, 96, 97, 99 };
Working solution
I made the code change, use HashSet to store the new updated value first, and then update dp[] array in the last.
public class Solution {
public bool CanPartition(int[] nums) {
if(nums == null || nums.Length == 0)
return false;
var length = nums.Length;
var sum = nums.Sum();
if(sum % 2 == 1)
return false;
var target = sum / 2;
var dp = new bool[sum + 1]; // target + 1 optimal
//Array.Sort(nums);
var prefixSum = 0;
for(int i = 0; i < nums.Length; i++)
{
var current = nums[i];
// hard to figure out - only add once - this bug
var nextRound = new HashSet<int>();
for (int j = 1; j <= prefixSum; j++)
{
if (dp[j])
{
nextRound.Add(j + current);
}
}
foreach (var item in nextRound)
{
dp[item] = true;
}
dp[current] = true;
prefixSum += current;
if (dp[target])
return true;
}
return dp[target];
}
}