problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::encrypt_and_decrypt_strings 命名空间参考

  1. 加密解密字符串
更多...

class  Encrypter
 

函数

 TEST (encrypt_and_decrypt_strings, case1)
 

详细描述

  1. 加密解密字符串

函数说明

◆ TEST()

leetcode::encrypt_and_decrypt_strings::TEST ( encrypt_and_decrypt_strings  ,
case1   
)

在文件 leetcode_test.cpp2700 行定义.

2700 {
2701 vector keys = {'a', 'b', 'c', 'd'};
2702 vector<string> values = {"ei", "zf", "ei", "am"};
2703 vector<string> dictionary = {"abcd", "acbd", "adbc", "badc", "dacb", "cadb", "cbda", "abad"};
2704 auto enc = Encrypter(keys, values, dictionary);
2705 ASSERT_EQ("eizfeiam", enc.encrypt("abcd"));
2706 ASSERT_EQ(2, enc.decrypt("eizfeiam"));
2707 }