摘要: Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it e 阅读全文
posted @ 2020-08-26 15:26 CNoodle 阅读(211) 评论(0) 推荐(0)
摘要: Given two vectors of integers v1 and v2, implement an iterator to return their elements alternately. Implement the ZigzagIterator class: ZigzagIterato 阅读全文
posted @ 2020-08-26 14:09 CNoodle 阅读(242) 评论(0) 推荐(0)
摘要: You have n processes forming a rooted tree structure. You are given two integer arrays pid and ppid, where pid[i] is the ID of the ith process and ppi 阅读全文
posted @ 2020-08-26 05:46 CNoodle 阅读(607) 评论(0) 推荐(0)
摘要: Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For 阅读全文
posted @ 2020-08-26 01:50 CNoodle 阅读(257) 评论(0) 推荐(0)