From 1b07106f8ec0670c7b1734c5dc5faa898d164419 Mon Sep 17 00:00:00 2001 From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Date: Wed, 8 May 2019 19:26:48 -0700 Subject: [PATCH] fix: removed guide articles no longer needed (#35679) --- .../remove-from-a-set/index.md | 55 ------------------- .../data-structures/size-of-the-set/index.md | 49 ----------------- 2 files changed, 104 deletions(-) delete mode 100644 guide/english/certifications/coding-interview-prep/data-structures/remove-from-a-set/index.md delete mode 100644 guide/english/certifications/coding-interview-prep/data-structures/size-of-the-set/index.md diff --git a/guide/english/certifications/coding-interview-prep/data-structures/remove-from-a-set/index.md b/guide/english/certifications/coding-interview-prep/data-structures/remove-from-a-set/index.md deleted file mode 100644 index fefff27e03..0000000000 --- a/guide/english/certifications/coding-interview-prep/data-structures/remove-from-a-set/index.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: Remove from a Set ---- -## Remove from a Set -![:triangular_flag_on_post:](https://forum.freecodecamp.com/images/emoji/emoji_one/triangular_flag_on_post.png?v=3 ":triangular_flag_on_post:") Remember to use **`Read-Search-Ask`** if you get stuck. Try to pair program ![:busts_in_silhouette:](https://forum.freecodecamp.com/images/emoji/emoji_one/busts_in_silhouette.png?v=3 ":busts_in_silhouette:") and write your own code ![:pencil:](https://forum.freecodecamp.com/images/emoji/emoji_one/pencil.png?v=3 ":pencil:") - -### ![:checkered_flag:](https://forum.freecodecamp.com/images/emoji/emoji_one/checkered_flag.png?v=3 ":checkered_flag:") Problem Explanation: - -To solve this problem, you have to write a function for the class that removes a given element from the array if the array contains the given element. - - -## ![:speech_balloon:](https://forum.freecodecamp.com/images/emoji/emoji_one/speech_balloon.png?v=3 ":speech_balloon:") Hint: 1 - - -Use the built-in "has" function already created to test if the element exists in the Set. - -> _try to solve the problem now_ - -## ![:speech_balloon:](https://forum.freecodecamp.com/images/emoji/emoji_one/speech_balloon.png?v=3 ":speech_balloon:") Hint: 2 - -Use the splice function to delete an element from an array. - -> _try to solve the problem now_ - - - -## Spoiler Alert! - -![:warning:](https://forum.freecodecamp.com/images/emoji/emoji_one/warning.png?v=3 ":warning:") - -**Solution ahead!** - -## ![:beginner:](https://forum.freecodecamp.com/images/emoji/emoji_one/beginner.png?v=3 ":beginner:") Basic Code Solution: - - this.remove = function(element){ - if(this.has(element)) { - this.values().splice( this.values().indexOf(element), 1 ); - } - } - -![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 ":rocket:") Run Code - -### Code Explanation: - -* The if statement checks if the collection contains the element. -* If the if statement evaluates to true, then starting from the index at which the element is located, one element is deleted. -* If the if statement evaluates to false, then nothing occurs. - -## ![:clipboard:](https://forum.freecodecamp.com/images/emoji/emoji_one/clipboard.png?v=3 ":clipboard:") NOTES FOR CONTRIBUTIONS: - -![:warning:](https://forum.freecodecamp.com/images/emoji/emoji_one/warning.png?v=3 ":warning:") **DO NOT** add solutions that are similar to any existing solutions. If you think it is **_similar but better_**, then try to merge (or replace) the existing similar solution. - -Add an explanation of your solution. - -Categorize the solution in one of the following categories — **Basic**, **Intermediate** and **Advanced**. ![:traffic_light:](https://forum.freecodecamp.com/images/emoji/emoji_one/traffic_light.png?v=3 ":traffic_light:") diff --git a/guide/english/certifications/coding-interview-prep/data-structures/size-of-the-set/index.md b/guide/english/certifications/coding-interview-prep/data-structures/size-of-the-set/index.md deleted file mode 100644 index 2f4a863642..0000000000 --- a/guide/english/certifications/coding-interview-prep/data-structures/size-of-the-set/index.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Size of the Set ---- -## Size of the Set -![:triangular_flag_on_post:](https://forum.freecodecamp.com/images/emoji/emoji_one/triangular_flag_on_post.png?v=3 ":triangular_flag_on_post:") Remember to use **`Read-Search-Ask`** if you get stuck. Try to pair program ![:busts_in_silhouette:](https://forum.freecodecamp.com/images/emoji/emoji_one/busts_in_silhouette.png?v=3 ":busts_in_silhouette:") and write your own code ![:pencil:](https://forum.freecodecamp.com/images/emoji/emoji_one/pencil.png?v=3 ":pencil:") - -### ![:checkered_flag:](https://forum.freecodecamp.com/images/emoji/emoji_one/checkered_flag.png?v=3 ":checkered_flag:") Problem Explanation: - -To solve this problem, you have to write a function for the class that returns the size of the set. - - -## ![:speech_balloon:](https://forum.freecodecamp.com/images/emoji/emoji_one/speech_balloon.png?v=3 ":speech_balloon:") Hint: 1 - -Create a size function in the Set class. - -> _try to solve the problem now_ - -## ![:speech_balloon:](https://forum.freecodecamp.com/images/emoji/emoji_one/speech_balloon.png?v=3 ":speech_balloon:") Hint: 2 - -Use the length attribute on the values of the Set. - -> _try to solve the problem now_ - - - -## Spoiler Alert! - -![warning sign](//discourse-user-assets.s3.amazonaws.com/original/2X/2/2d6c412a50797771301e7ceabd554cef4edcd74d.gif) - -**Solution ahead!** - -## ![:beginner:](https://forum.freecodecamp.com/images/emoji/emoji_one/beginner.png?v=3 ":beginner:") Basic Code Solution: - - this.size = function() - { - return this.values().length; - } - -![:rocket:](https://forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=3 ":rocket:") Run Code - -### Code Explanation: - -* The number of items is achieved by attaining the collection using the "values" function and getting the length attribute of it. - -## ![:clipboard:](https://forum.freecodecamp.com/images/emoji/emoji_one/clipboard.png?v=3 ":clipboard:") NOTES FOR CONTRIBUTIONS: - -* ![:warning:](https://forum.freecodecamp.com/images/emoji/emoji_one/warning.png?v=3 ":warning:") **DO NOT** add solutions that are similar to any existing solutions. If you think it is **_similar but better_**, then try to merge (or replace) the existing similar solution. -* Add an explanation of your solution. -* Categorize the solution in one of the following categories — **Basic**, **Intermediate** and **Advanced**. ![:traffic_light:](https://forum.freecodecamp.com/images/emoji/emoji_one/traffic_light.png?v=3 ":traffic_light:")