Last active
October 5, 2022 13:51
-
-
Save achikin/ada1a95ad12b38077f47130c2bddd6fe to your computer and use it in GitHub Desktop.
Revisions
-
achikin revised this gist
Oct 5, 2022 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Given social network posts in the following format: ``` [ {"date": "12.10.2019", @@ -29,6 +29,7 @@ Example: {"date": "21.12.2019", "text": "Fish!", "likes": [1, 2]}, {"date": "21.12.2019", "text": "Apples :((", "likes": [1, 2, 3]} @@ -47,5 +48,7 @@ The result should be: ["Mary", "John"] ``` Any questions are welcome! ### Useful hints - You can use https://github.com/dakrone/cheshire to parse json files -
achikin revised this gist
Oct 5, 2022 . 2 changed files with 12 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,10 @@ Given social network posts in the following format {"date": "12.10.2019", "text": "I love trouts!", "likes": [1, 2, 3, 4]}, {"date": "17.10.2019", "text": "Hello world!", "likes": [1, 2, 3, 4]}б ... ] ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,37 +5,37 @@ "likes": [2, 3, 6]}, {"id": 2, "date": "15.10.2019", "text": "I hate apples", "likes": [6, 1, 2, 3, 4]}, {"id": 3, "date": "23.12.2019", "text": "I bought an iPhone.", "likes": [6, 2]}, {"id": 4, "date": "02.02.2020", "text": "Vote for spaghetti!", "likes": [5, 1, 3, 6, 2]}, {"id": 5, "date": "31.05.2020", "text": "How do you like the last Marvell movie?", "likes": [2, 6, 1]}, {"id": 6, "date": "01.01.2022", "text": "I hate fish.", "likes": [3, 4, 6, 2]}, {"id": 7, "date": "31.12.2022", "text": "I saw the Bigfoot on my backyard.", "likes": [4, 1, 2, 6]}, {"id": 8, "date": "01.03.2019", "text": "I'm having fun in Paris", "likes": [1, 2, 3, 4, 5, 6]}, -
achikin revised this gist
Dec 17, 2019 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,4 +41,7 @@ Example: The result should be: ["Mary", "John"] ``` ### Useful hints - You can use https://github.com/dakrone/cheshire to parse json files -
achikin revised this gist
Dec 17, 2019 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,10 +22,12 @@ Example: ``` // posts [ {"date": "21.12.2019", "text": "Fish!", "likes": [1, 2]}, {"date": "21.12.2019", "text": "Apples :((", "likes": [1, 2, 3]} ] //users [ @@ -37,6 +39,6 @@ Example: "name": "Jane"}, ] The result should be: ["Mary", "John"] ``` -
achikin revised this gist
Dec 17, 2019 . 2 changed files with 55 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ [ {"id": 1, "date": "12.10.2019", "text": "I like fish.", "likes": [2, 3, 6]}, {"id": 2, "date": "12.10.2019", "text": "I hate apples", "likes": [6, 1, 2, 3, 4]}, {"id": 3, "date": "12.10.2019", "text": "I bought iPhone.", "likes": [6, 2]}, {"id": 4, "date": "12.10.2019", "text": "Vote for spaghetti!", "likes": [5, 1, 3, 6, 2]}, {"id": 5, "date": "12.10.2019", "text": "How do you like the last Marvell movie?", "likes": [2, 6, 1]}, {"id": 6, "date": "12.10.2019", "text": "I hate fish.", "likes": [3, 4, 6, 2]}, {"id": 7, "date": "12.10.2019", "text": "I saw the Bigfoot on my backyard.", "likes": [4, 1, 2, 6]}, {"id": 8, "date": "12.10.2019", "text": "I'm having fun in Paris", "likes": [1, 2, 3, 4, 5, 6]}, {"id": 9, "date": "12.10.2019", "text": "Check out my new clojure library github.com/user/clojure-library", "likes": [6, 1, 2, 3, 4]} ] This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ [ {"id": 1, "name": "John"}, {"id": 2, "name": "Mary"}, {"id": 3, "name": "Anton"}, {"id": 4, "name": "Batman"}, {"id": 5, "name": "Jesica"}, {"id": 6, "name": "Ivan"}, {"id": 7, "name": "Petra"} ] -
achikin revised this gist
Dec 17, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,8 +12,8 @@ Given social network posts in the following format And given users in the following format ``` [ {"id": 1 "name": "John"}, ... ] ``` -
achikin revised this gist
Dec 17, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,8 @@ Given social network posts in the following format ] ``` `likes` is a list of user ids that liked a post And given users in the following format ``` [ {:id 1 -
achikin revised this gist
Dec 17, 2019 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,13 @@ Given social network posts in the following format ``` [ {"date": "12.10.2019", "text": "I love trouts!", "likes": [1, 2, 3, 4]}, ... ] ``` `likes` is a list of user ids that liked a post And users in the following format ``` [ -
achikin revised this gist
Dec 17, 2019 . 1 changed file with 40 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,40 @@ Given social network posts in the following format ```json [ {"date": "12.10.2019", "text": "I love trouts!", "likes": [1, 2, 3, 4]}, // likes is a list of users' ids that liked a post ... ] ``` And users in the following format ``` [ {:id 1 :name "John"}, ... ] ``` Find the names of the users, that liked all posts. Example: ``` // posts [ {... "likes": [1, 2]}, {... "likes": [2, 3]} ] //users [ {"id": 1, "name": "John"}, {"id": 2, "name": "Mary"}, {"id": 3, "name": "Jane"}, ] The result should be ["Mary"] ``` -
achikin created this gist
Dec 17, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ 1