Skip to content

Commit b7137f1

Browse files
committed
test: [20250913] Add (3541)
1 parent 5adf9e1 commit b7137f1

File tree

11 files changed

+101
-7
lines changed

11 files changed

+101
-7
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ members = [
316316
"problems/problems_1733",
317317
"problems/problems_2785",
318318
"problems/problems_3227",
319+
"problems/problems_3541",
319320
]
320321

321322
[package]
@@ -654,3 +655,4 @@ solution_2327 = { path = "problems/problems_2327", features = ["solution_2327"]
654655
solution_1733 = { path = "problems/problems_1733", features = ["solution_1733"] }
655656
solution_2785 = { path = "problems/problems_2785", features = ["solution_2785"] }
656657
solution_3227 = { path = "problems/problems_3227", features = ["solution_3227"] }
658+
solution_3541 = { path = "problems/problems_3541", features = ["solution_3541"] }

daily-problems.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"daily": "827",
2+
"daily": "3541",
33
"plans": ["3674", "problems", "3675", "problems", "3676", "problems"]
44
}

golang/solution_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package golang
22

33
import (
4-
problem "leetCode/problems/problems_827"
4+
problem "leetCode/problems/problems_3541"
55
"testing"
66
)
77

88
func TestSolution(t *testing.T) {
9-
TestEach(t, "827", "problems", problem.Solve)
9+
TestEach(t, "3541", "problems", problem.Solve)
1010
}

problems/problems_3541/Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "solution_3541"
3+
version = "0.1.0"
4+
edition = "2021"
5+
rust-version = "1.79.0"
6+
authors = ["benhao"]
7+
description = "LeetCode Solution 3541 in Rust"
8+
readme = "../../README.md"
9+
10+
[features]
11+
solution_3541 = []
12+
13+
[dependencies]
14+
serde_json = "1.0"
15+
rand = "0.8.4"
16+
regex = "1.10.5"
17+
library = { path = "../../rust/library", features = ["model"] }
18+
19+
[lib]
20+
name = "solution_3541"
21+
path = "solution.rs"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//go:build ignore
2+
#include "cpp/common/Solution.h"
3+
4+
5+
using namespace std;
6+
using json = nlohmann::json;
7+
8+
class Solution {
9+
public:
10+
int maxFreqSum(string s) {
11+
12+
}
13+
};
14+
15+
json leetcode::qubh::Solve(string input_json_values) {
16+
vector<string> inputArray;
17+
size_t pos = input_json_values.find('\n');
18+
while (pos != string::npos) {
19+
inputArray.push_back(input_json_values.substr(0, pos));
20+
input_json_values = input_json_values.substr(pos + 1);
21+
pos = input_json_values.find('\n');
22+
}
23+
inputArray.push_back(input_json_values);
24+
25+
Solution solution;
26+
string s = json::parse(inputArray.at(0));
27+
return solution.maxFreqSum(s);
28+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package problems.problems_3541;
2+
3+
import com.alibaba.fastjson.JSON;
4+
import java.util.*;
5+
import qubhjava.BaseSolution;
6+
7+
8+
public class Solution extends BaseSolution {
9+
public int maxFreqSum(String s) {
10+
11+
}
12+
13+
@Override
14+
public Object solve(String[] inputJsonValues) {
15+
String s = jsonStringToString(inputJsonValues[0]);
16+
return JSON.toJSON(maxFreqSum(s));
17+
}
18+
}

problems/problems_3541/problem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 3541. Find Most Frequent Vowel and Consonant
1+
# 3541. Find Most Frequent Vowel and Consonant [Rating: 1238.88]
22

33
<p>You are given a string <code>s</code> consisting of lowercase English letters (<code>&#39;a&#39;</code> to <code>&#39;z&#39;</code>). </p>
44

problems/problems_3541/problem_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 3541. 找到频率最高的元音和辅音
1+
# 3541. 找到频率最高的元音和辅音 [难度分: 1238.88]
22

33
<p>给你一个由小写英文字母(<code>'a'</code> 到 <code>'z'</code>)组成的字符串 <code>s</code>。你的任务是找出出现频率&nbsp;<strong>最高&nbsp;</strong>的元音(<code>'a'</code>、<code>'e'</code>、<code>'i'</code>、<code>'o'</code>、<code>'u'</code> 中的一个)和出现频率<strong>最高</strong>的辅音(除元音以外的所有字母),并返回这两个频率之和。</p>
44

problems/problems_3541/solution.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use serde_json::{json, Value};
2+
3+
pub struct Solution;
4+
5+
impl Solution {
6+
pub fn max_freq_sum(s: String) -> i32 {
7+
8+
}
9+
}
10+
11+
#[cfg(feature = "solution_3541")]
12+
pub fn solve(input_string: String) -> Value {
13+
let input_values: Vec<String> = input_string.split('\n').map(|x| x.to_string()).collect();
14+
let s: String = serde_json::from_str(&input_values[0]).expect("Failed to parse input");
15+
json!(Solution::max_freq_sum(s))
16+
}

problems/problems_3541/solution.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function maxFreqSum(s: string): number {
2+
3+
};
4+
5+
export function Solve(inputJsonElement: string): any {
6+
const inputValues: string[] = inputJsonElement.split("\n");
7+
const s: string = JSON.parse(inputValues[0]);
8+
return maxFreqSum(s);
9+
}

0 commit comments

Comments
 (0)