File tree 2 files changed +28
-3
lines changed
2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change
1
+ pub struct Solution ;
2
+ impl Solution {
3
+ pub fn first_uniq_char ( s : String ) -> i32 {
4
+ return 0 ;
5
+ }
6
+ }
7
+
8
+ #[ cfg( test) ]
9
+ mod tests {
10
+ use super :: * ;
11
+
12
+ #[ test]
13
+ fn test_1 ( ) {
14
+ assert_eq ! ( Solution :: first_uniq_char( "leetcode" . to_string( ) ) , 0 ) ;
15
+ }
16
+
17
+ #[ test]
18
+ fn test_2 ( ) {
19
+ assert_eq ! ( Solution :: first_uniq_char( "loveleetcode" . to_string( ) ) , 2 ) ;
20
+ }
21
+
22
+ #[ test]
23
+ fn test_3 ( ) {
24
+ assert_eq ! ( Solution :: first_uniq_char( "aabb" . to_string( ) ) , -1 ) ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change 1
- mod romen_to_integer ;
1
+ mod find_unique_character ;
2
2
fn main ( ) {
3
- let romen = "MCMXCIV" . to_string ( ) ;
4
- let result = romen_to_integer:: Solution :: roman_to_int ( romen) ;
3
+ let result = find_unique_character:: Solution :: first_uniq_char ( "leetcode" . to_string ( ) ) ;
5
4
println ! ( "{:?}" , result) ;
6
5
}
You can’t perform that action at this time.
0 commit comments