filterData.map(c => {
const [m, y] = c.validTill.split('/')
const date = new Date(2000 + Number(y), m, 1, 23) // придется переписать в 22м веке :(
date.setDate(date.getDate() - 1)
return {
product: c.product,
maskedNum: c.cardNum.slice(0, 4) + ' ****** ' + c.cardNum.slice(-4),
validDate: date.toISOString()
}
})
const filterData = data.filter(el => {
return (el.cardNum.startsWith('1234') || el.cardNum.startsWith('4234'))
&& (el.cardStatus === 'X' || el.cardStatus === '+');
});
console.log(filterData);
>>> set([1, 4, 3]) == set([4, 3, 1])
True
list = [[0, 0, 0], [30, 15, 25], [20, 5, 15], [10, -5, 5], [0, -15, -5], [15,25,30]]
stack = []
set_to_index = {}
for i, trio in enumerate(list):
cur_set = frozenset(trio)
if cur_set in set_to_index:
print(f'found! l[{i}] = l[{set_to_index[cur_set]}] = {trio}')
else:
stack.append(trio)
set_to_index[cur_set] = i
// https://mvnrepository.com/artifact/org.telegram/telegrambots
compile group: 'org.telegram', name: 'telegrambots', version: '4.4.0.2'
<!-- https://mvnrepository.com/artifact/org.telegram/telegrambots -->
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>4.4.0.2</version>
</dependency>