Competitive-Coding-10 - #471
Conversation
Interview Problem : Buy and Sell Stock (MinimumCostsForTickets.swift)It appears you have solved the "Minimum Cost For Tickets" problem instead of the "Buy and Sell Stock" problem. Please ensure you are solving the correct problem. For the "Buy and Sell Stock" problem, you need to maximize profit by buying and selling stocks with the ability to hold at most one share at a time. You can use a greedy approach or dynamic programming to solve it efficiently. I recommend revisiting the problem statement and implementing a solution specifically for that. VERDICT: NEEDS_IMPROVEMENT Interview Problem: Peeking Iterator (WordLadder.swift)It appears there has been a mix-up in the code submission. The problem you were asked to solve is "Peeking Iterator", but the code you provided is for "Word Ladder". For the Peeking Iterator problem, you need to design a class that wraps an existing iterator and adds a peek functionality. The key idea is to cache the next element so that peek can return it without advancing the iterator. Here are some tips for implementing PeekingIterator:
Please review the problem statement again and implement the correct solution. If you have any questions about the Peeking Iterator problem, feel free to ask. VERDICT: NEEDS_IMPROVEMENT |
-> Length of the word ladder
-> Calculate minimum cost for tickets