Great interview, thank you to all the participants and organizers! One note: I think that DSA problem-s solution presented will consider subsequences and not substring as required by the problem statement, it will work for "abcabcbb" and for "bbbbb" but not for "pwwkew". For pwwkew it will return 4 (pwke) and not 3 (wke). My solution will work for all 3 cases, instead of incrementing left by one I "reset" it and make it = idx, however it wont work for more complicated case like this one: 'cyraffjhzxc' . I am curios what would be a complete solution. def solution_99 (text) -> str: left = max_len = 0 my_set = set() for idx, val in enumerate(text): while val in my_set: my_set.remove(val) left = idx my_set.add(val) max_len = max(max_len, idx-left+1) return max_len
@ShubhamYadav-gq6fe7 ай бұрын
Why to use join in the sql question??? How about this Solution: With cte as ( select * , Case when shipping_add != bill_add then “invalid” Else “valid” end as Order_check from orders) Select order_id from cte where Cust_id in (select Cust_id from cte where order_check= “invalid”)
@SuddhasatwaBhaumik7 ай бұрын
Inline subqueries are costly
@abhiksaha34515 ай бұрын
@@SuddhasatwaBhaumik Why will this simple select statement wont work. Am I missing something? Select * from orders where billing_address!=shipping_address;
@ameygoesgaming87937 ай бұрын
I didn't get the second question at all. A customer can order to different addresses, with different order ids. Suppose, I place an order today for myself for the address pune with both addresses being same, tomorrow I can place it for my friend for the address Mumbai with both billing and shipping address for Mumbai. No matter what, in the context of the question, all of the rows will be marked respective of anything, because how would we know, which address to be called as customers real address to compare to? _ i think candidate should have asked / interviewer should have clarified. E.g. she was assuming first record to be real address and was comparing others to it. So i don't. Please help me understand the question again. I think simple where condition should do the work - her first approach
@SuddhasatwaBhaumik7 ай бұрын
The question was only to check how one can use simple solutions to find row wise differences