Добавить
Уведомления

Leetcode, 2665 Counter II четвертая задача

Write a function createCounter. It should accept an initial integer init. It should return an object with three functions. The three functions are: increment() increases the current value by 1 and then returns it. decrement() reduces the current value by 1 and then returns it. reset() sets the current value to init and then returns it.

Иконка канала Введение в Python
4 подписчика
12+
18 просмотров
2 года назад
12+
18 просмотров
2 года назад

Write a function createCounter. It should accept an initial integer init. It should return an object with three functions. The three functions are: increment() increases the current value by 1 and then returns it. decrement() reduces the current value by 1 and then returns it. reset() sets the current value to init and then returns it.

, чтобы оставлять комментарии