Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/main/java/io/zipcoder/Problem1.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,50 @@
package io.zipcoder;

import java.util.*;

public class Problem1 {

public static void main(String[] args) {
String input = "The Farmer went to the store to get 1 dollar’s worth of fertilizer";
String keyReplacers = "‘f’ : ‘7’, ‘s’:’$’, ‘1’:’!’, ‘a’.:’@’";
String result = "";




}

public void createHashMap(){
String input = "The Farmer went to the store to get 1 dollar’s worth of fertilizer";
String keyReplacers = "‘f’ : ‘7’, ‘s’:’$’, ‘1’:’!’, ‘a’.:’@’";
String result = "";
HashMap<String,String> values = new HashMap<String, String>();
//values.put(input,result);
// for (Map.Entry<String, String> entry : values.entrySet()) {
// input = input.replace(input + entry.getKey() + result, entry.getValue());
// result = input;
// }
// System.out.println(result);
values.put("f","7");
values.put("s","$");
values.put("1","!");
values.put("a","@");
for (Map.Entry<String, String> valueReplacer : values.entrySet()) {
result = input.replace("f" + "s","7"+"$" );

}

}







//I know I am not there yet. I had a general idea. With more time I would have gotten it. I was going to use the map to replace
//hasNext



}
17 changes: 17 additions & 0 deletions src/test/java/io/zipcoder/Problem1Test.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
package io.zipcoder;
import org.junit.*;

public class Problem1Test {

@Test
public void mainTest(){
String input = "The Farmer went to the store to get 1 dollar’s worth of fertilizer";

String expected = "The 7@rmer went to the $tore to get ! doll@r’$ worth of 7ertilizer";

String actual = "";

Assert.assertEquals(expected,actual);

}




}