Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I spent over an hour to write the algorithm first with time complexity \$O(nm)\$, where \$n\$ is the sentence's length and \$m\$ is delimiters length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ for correct syntax by looking up the stackoverflow questionthe stackoverflow question to make the code more succinct.

I spent over an hour to write the algorithm first with time complexity \$O(nm)\$, where \$n\$ is the sentence's length and \$m\$ is delimiters length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ for correct syntax by looking up the stackoverflow question to make the code more succinct.

I spent over an hour to write the algorithm first with time complexity \$O(nm)\$, where \$n\$ is the sentence's length and \$m\$ is delimiters length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ for correct syntax by looking up the stackoverflow question to make the code more succinct.

fixed grammar, added reinventing-the-wheel
Source Link

LINQ and string.Split Dodo it yourself practice

Problem Statement:

Implement a sentence scanning functionality to parse the sentence and return a string to concatenate each word with its number of occurrences, sorted by the number of occurrences in descending order.

For example, with the sentence "code review connects the world! share the code" " code review connects the world! share the code", the function returns the string: {code: 2, the: 2, review: 1, connects: 1, world: 1, share: 1}. The delimiters are customized as function input argument, for the above test case, the delimiters are " " ,!",!".

I spent over an hour to write the algorithm first with time complexity O(nm)\$O(nm)\$, where n\$n\$ is the sentence's length and m\$m\$ is delimiters'delimiters length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ for correct syntax by looking up the stackoverflow question to make the code more succinct.

LINQ and string.Split Do it yourself practice

Problem Statement:

Implement a sentence scanning functionality to parse the sentence and return a string to concatenate each word with its number of occurrences, sorted by the number of occurrences in descending order.

For example, with the sentence " code review connects the world! share the code", the function returns the string: {code: 2, the: 2, review: 1, connects: 1, world: 1, share: 1}. The delimiters are customized as function input argument, for the above test case, the delimiters are " ,!".

I spent over an hour to write the algorithm first with time complexity O(nm), where n is the sentence's length and m is delimiters' length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ for correct syntax by looking up the stackoverflow question to make code more succinct.

LINQ and string.Split do it yourself practice

Problem Statement:

Implement a sentence scanning functionality to parse the sentence and return a string to concatenate each word with its number of occurrences, sorted by the number of occurrences in descending order.

For example, with the sentence "code review connects the world! share the code" , the function returns the string: {code: 2, the: 2, review: 1, connects: 1, world: 1, share: 1}. The delimiters are customized as function input argument, for the above test case, the delimiters are " ,!".

I spent over an hour to write the algorithm first with time complexity \$O(nm)\$, where \$n\$ is the sentence's length and \$m\$ is delimiters length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ for correct syntax by looking up the stackoverflow question to make the code more succinct.

add LINQ reference on stackoverflow.com to look up sort by dictionary's value by descending order.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52

I spent over an hour to write the algorithm first with time complexity O(nm), where n is the sentence's length and m is delimiters' length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ for correct syntax by looking up the stackoverflow question to make code more succinct.

I spent over an hour to write the algorithm first with time complexity O(nm), where n is the sentence's length and m is delimiters' length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ to make code more succinct.

I spent over an hour to write the algorithm first with time complexity O(nm), where n is the sentence's length and m is delimiters' length. I practiced using C#, tried to write a string.Split(string) by myself, and also learn to write LINQ for correct syntax by looking up the stackoverflow question to make code more succinct.

Add a sentence about coding passes two test case function calls.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52
Loading
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52
Loading