Find the devices that have no revoked time, and extract out the duration left on their leases.
Extract non-revoked devices and the duration of their leases.
Start file
{
"devices": [
{
"deviceId": "Mac14_6_5ba3030d2b36441d9fb186ea65df6b66",
"platform": "OSXEditor",
"name": "Whitakr-MacBook-Pro",
"activatedAt": 1767580222997,
"lastSeen": 1767611345716,
"revokedAt": 1767611362585,
"leaseUntil": 1767697745716
},
{
"deviceId": "iPad1",
"platform": "ios",
"name": "iPad",
"activatedAt": 1767611327269,
"lastSeen": 1767611327269,
"revokedAt": 1767611362585,
"leaseUntil": 1767697727269
},
{
"deviceId": "iPad2",
"platform": "ios",
"name": "iPad",
"activatedAt": 1767611369550,
"lastSeen": 1767611369550,
"revokedAt": null,
"leaseUntil": 1767697769550
},
{
"deviceId": "iPad3",
"platform": "ios",
"name": "iPad",
"activatedAt": 1767611369552,
"lastSeen": 1767611369552,
"revokedAt": null,
"leaseUntil": 1767784169552
}
]
}
End file
{
"deviceLeaseDurations": [
"iPad2": 86400000,
"iPad3": 172800000
]
}
View Diff
2,38c2,4
< "devices": [
< {
< "deviceId": "Mac14_6_5ba3030d2b36441d9fb186ea65df6b66",
< "platform": "OSXEditor",
< "name": "Whitakr-MacBook-Pro",
< "activatedAt": 1767580222997,
< "lastSeen": 1767611345716,
< "revokedAt": 1767611362585,
< "leaseUntil": 1767697745716
< },
< {
< "deviceId": "iPad1",
< "platform": "ios",
< "name": "iPad",
< "activatedAt": 1767611327269,
< "lastSeen": 1767611327269,
< "revokedAt": 1767611362585,
< "leaseUntil": 1767697727269
< },
< {
< "deviceId": "iPad2",
< "platform": "ios",
< "name": "iPad",
< "activatedAt": 1767611369550,
< "lastSeen": 1767611369550,
< "revokedAt": null,
< "leaseUntil": 1767697769550
< },
< {
< "deviceId": "iPad3",
< "platform": "ios",
< "name": "iPad",
< "activatedAt": 1767611369552,
< "lastSeen": 1767611369552,
< "revokedAt": null,
< "leaseUntil": 1767784169552
< }
---
> "deviceLeaseDurations": [
> "iPad2": 86400000,
> "iPad3": 172800000
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 6 remaining solutions by signing in and submitting your own entry
VimGolf