Как добавить сообщение об ошибке в моем проекте Unity, когда пакет активов имеет неправильный формат?

Вот решение для определения цикла.

public boolean hasCycle(ListNode head) {
            ListNode slow =head;
            ListNode fast =head;

            while(fast!=null && fast.next!=null){
                slow = slow.next; // slow pointer only one hop
                fast = fast.next.next; // fast pointer two hops 

                if(slow == fast)    return true; // retrun true if fast meet slow pointer
            }

            return false; // return false if fast pointer stop at end 
        }
0
задан Swathi 17 January 2019 в 07:21
поделиться