From 1f5f1bee8c3c7d2b8c2bcc0e785cb32ed2dded85 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Fri, 5 Aug 2022 16:52:51 +0200 Subject: [PATCH] fix: correct the comments and interface Signed-off-by: Matej Focko --- problems/flatten-nested-list-iterator.java | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/problems/flatten-nested-list-iterator.java b/problems/flatten-nested-list-iterator.java index 67c406a..e3cf218 100644 --- a/problems/flatten-nested-list-iterator.java +++ b/problems/flatten-nested-list-iterator.java @@ -2,6 +2,8 @@ import java.util.ArrayDeque; import java.util.Iterator; import java.util.List; +// This is the interface that allows for creating nested lists. +// You should not implement it, or speculate about its implementation interface NestedInteger { // @return true if this NestedInteger holds a single integer, rather than a nested list. public boolean isInteger(); @@ -13,23 +15,6 @@ interface NestedInteger { public List getList(); } -/** - * // This is the interface that allows for creating nested lists. - * // You should not implement it, or speculate about its implementation - * public interface NestedInteger { - * - * // @return true if this NestedInteger holds a single integer, rather than a nested list. - * public boolean isInteger(); - * - * // @return the single integer that this NestedInteger holds, if it holds a single integer - * // Return null if this NestedInteger holds a nested list - * public Integer getInteger(); - * - * // @return the nested list that this NestedInteger holds, if it holds a nested list - * // Return empty list if this NestedInteger holds a single integer - * public List getList(); - * } - */ class NestedIterator implements Iterator { private class DFSEntry {