Input: "a", ["b"]

Output: true

Expected: false

class Solution {

public:

bool wordBreak(string s, unordered_set<string>& wordDict)

{

int len = s.length();

bool reach[len+1];

reach[0] = true;

```
for(int i = 1; i <= len; i++)
{
for(int j = 1; j <= i; j++)
{
if(reach[j-1])
{
string temp = s.substr(j-1,i-j+1);
if(wordDict.find(temp) != wordDict.end())
{
reach[i] = true;
break;
}
}
}
}
return reach[len];
```

}

};