SignalerCodeWithWho@CodeWithWhoBuilding software that solves real problems. Software Engineer | Frontend | Backend Shipping ideas to the internet.https://t.co/coDfAjyBAeInscrit en mars 2026158 Abonnements99 Abonnés930 PostsPostsMédiasCodeWithWho@CodeWithWho·7moYesterday I wore an article on how my last week went Its is posted on LinkedInPartagerCopié017247CodeWithWho@CodeWithWho·2dTaking every customer from one list and rescanning a huge second dataset each time works, but it scales badly. #softwareengineering #algorithms Watch:TéléchargerPartagerCopié000CodeWithWho@CodeWithWho·2dIntersection means unique common values. If 3 is already in the result, another 3 should not be added again. #arrays #algorithms Watch:TéléchargerPartagerCopié0003CodeWithWho@CodeWithWho·2dOnce A[i] matches something in B, existence is confirmed. Add it and stop scanning for that candidate. #algorithms #python Watch:TéléchargerPartagerCopié0002CodeWithWho@CodeWithWho·2dOne value from A can force a full scan of B when no match exists. That's where repeated work begins. #algorithms #optimization Watch:TéléchargerPartagerCopié0007CodeWithWho@CodeWithWho·2dBrute force: take one unique value from A, scan B for a match, add it if found, then repeat. #algorithms #arrays Watch:TéléchargerPartagerCopié0005CodeWithWho@CodeWithWho·3dAlgorithm choice depends on data shape. 1M vs 1M and 100 vs 10M may deserve completely different strategies. #softwareengineering #algorithms Watch:TéléchargerPartagerCopié00113CodeWithWho@CodeWithWho·3dn << m could mean 100 values vs 1,000,000. Same problem, very different data shape. #algorithms #optimization Watch:TéléchargerPartagerCopié0007CodeWithWho@CodeWithWho·3dn ≈ m means roughly the same scale, not exactly equal. Example: 1,000 vs 1,200 elements. #algorithms Watch:TéléchargerPartagerCopié0005CodeWithWho@CodeWithWho·3dIf the problem tells you the arrays are sorted, use that information. Sorted order can eliminate unnecessary work. #algorithms #optimization Watch:TéléchargerPartagerCopié0005CodeWithWho@CodeWithWho·3dArray intersection = values that exist in both A and B, with no duplicates in the result. #algorithms #arrays Watch:TéléchargerPartagerCopié0027CodeWithWho@CodeWithWho·4dBrute force remembers used positions. Hashing remembers remaining quantity. The better representation removes repeated discovery. #optimization #hashtables Watch:TéléchargerPartagerCopié0004CodeWithWho@CodeWithWho·4dEvery character in L may scan all of M: O(l × m), or roughly O(n²) when both inputs are similar in size. #bigO #algorithms Watch:TéléchargerPartagerCopié00017CodeWithWho@CodeWithWho·4dBrute force repeatedly searches M. Hashing builds inventory once and consumes it. Same answer, much less repeated work. #algorithms #hashtables Watch:TéléchargerPartagerCopié0004CodeWithWho@CodeWithWho·5dCount already 0? Fail immediately. Same logic applies to stock, seats, credits and quotas in real systems. #softwareengineering #hashtables Watch:TéléchargerPartagerCopié0027CodeWithWho@CodeWithWho·5dSecond 'a'? No search. Read char_count['a'], decrement, continue. That's the hash-table advantage. #optimization #hashtables Watch:TéléchargerPartagerCopié0003CodeWithWho@CodeWithWho·5dLetter demand just decrements inventory: a 2→1, b 1→0. No magazine rescan. #algorithms #hashtables Watch:TéléchargerPartagerCopié0007CodeWithWho@CodeWithWho·5dOptimized debugger: watch the current char and char_count. Those two values show supply being built and consumed. #python #debugging Watch:TéléchargerPartagerCopié0001CodeWithWho@CodeWithWho·5dM='aabc' becomes a→2, b→1, c→1 in the debugger. Supply is built once before demand starts. #python #hashtables Watch:TéléchargerPartagerCopié0002CodeWithWho@CodeWithWho·6dTicket inventory uses the same idea: Standard→120, VIP→15, then bookings consume the counts. Resource → quantity → demand. #softwareengineering Watch:TéléchargerPartagerCopié0005CodeWithWho@CodeWithWho·6dCount already zero and demand asks for another unit? Fail immediately. No need to search for inventory we already know is gone. #hashtables #optimization Watch:TéléchargerPartagerCopié0003
CodeWithWho@CodeWithWho·7moYesterday I wore an article on how my last week went Its is posted on LinkedInPartagerCopié017247
CodeWithWho@CodeWithWho·2dTaking every customer from one list and rescanning a huge second dataset each time works, but it scales badly. #softwareengineering #algorithms Watch:TéléchargerPartagerCopié000
CodeWithWho@CodeWithWho·2dIntersection means unique common values. If 3 is already in the result, another 3 should not be added again. #arrays #algorithms Watch:TéléchargerPartagerCopié0003
CodeWithWho@CodeWithWho·2dOnce A[i] matches something in B, existence is confirmed. Add it and stop scanning for that candidate. #algorithms #python Watch:TéléchargerPartagerCopié0002
CodeWithWho@CodeWithWho·2dOne value from A can force a full scan of B when no match exists. That's where repeated work begins. #algorithms #optimization Watch:TéléchargerPartagerCopié0007
CodeWithWho@CodeWithWho·2dBrute force: take one unique value from A, scan B for a match, add it if found, then repeat. #algorithms #arrays Watch:TéléchargerPartagerCopié0005
CodeWithWho@CodeWithWho·3dAlgorithm choice depends on data shape. 1M vs 1M and 100 vs 10M may deserve completely different strategies. #softwareengineering #algorithms Watch:TéléchargerPartagerCopié00113
CodeWithWho@CodeWithWho·3dn << m could mean 100 values vs 1,000,000. Same problem, very different data shape. #algorithms #optimization Watch:TéléchargerPartagerCopié0007
CodeWithWho@CodeWithWho·3dn ≈ m means roughly the same scale, not exactly equal. Example: 1,000 vs 1,200 elements. #algorithms Watch:TéléchargerPartagerCopié0005
CodeWithWho@CodeWithWho·3dIf the problem tells you the arrays are sorted, use that information. Sorted order can eliminate unnecessary work. #algorithms #optimization Watch:TéléchargerPartagerCopié0005
CodeWithWho@CodeWithWho·3dArray intersection = values that exist in both A and B, with no duplicates in the result. #algorithms #arrays Watch:TéléchargerPartagerCopié0027
CodeWithWho@CodeWithWho·4dBrute force remembers used positions. Hashing remembers remaining quantity. The better representation removes repeated discovery. #optimization #hashtables Watch:TéléchargerPartagerCopié0004
CodeWithWho@CodeWithWho·4dEvery character in L may scan all of M: O(l × m), or roughly O(n²) when both inputs are similar in size. #bigO #algorithms Watch:TéléchargerPartagerCopié00017
CodeWithWho@CodeWithWho·4dBrute force repeatedly searches M. Hashing builds inventory once and consumes it. Same answer, much less repeated work. #algorithms #hashtables Watch:TéléchargerPartagerCopié0004
CodeWithWho@CodeWithWho·5dCount already 0? Fail immediately. Same logic applies to stock, seats, credits and quotas in real systems. #softwareengineering #hashtables Watch:TéléchargerPartagerCopié0027
CodeWithWho@CodeWithWho·5dSecond 'a'? No search. Read char_count['a'], decrement, continue. That's the hash-table advantage. #optimization #hashtables Watch:TéléchargerPartagerCopié0003
CodeWithWho@CodeWithWho·5dLetter demand just decrements inventory: a 2→1, b 1→0. No magazine rescan. #algorithms #hashtables Watch:TéléchargerPartagerCopié0007
CodeWithWho@CodeWithWho·5dOptimized debugger: watch the current char and char_count. Those two values show supply being built and consumed. #python #debugging Watch:TéléchargerPartagerCopié0001
CodeWithWho@CodeWithWho·5dM='aabc' becomes a→2, b→1, c→1 in the debugger. Supply is built once before demand starts. #python #hashtables Watch:TéléchargerPartagerCopié0002
CodeWithWho@CodeWithWho·6dTicket inventory uses the same idea: Standard→120, VIP→15, then bookings consume the counts. Resource → quantity → demand. #softwareengineering Watch:TéléchargerPartagerCopié0005
CodeWithWho@CodeWithWho·6dCount already zero and demand asks for another unit? Fail immediately. No need to search for inventory we already know is gone. #hashtables #optimization Watch:TéléchargerPartagerCopié0003