NEW YORK (AP) Two things were clear to the Charlotte Hornets after a pair of potentially costly losses.
Kemba Walker needed to play better, and they needed to win.
Done. And, done.
Walker scored 34 points, Al Jefferson had 24 and the Hornets bounced back from consecutive losses to the Eastern Conference's top teams by beating the New York Knicks 111-97 on Wednesday night.
Charlotte, which fell in Cleveland on Sunday and Toronto on Tuesday, needed a win to renew its hopes of getting home-court advantage in the first round of the playoffs. The Hornets are a game behind fourth-place Boston and half-game back of No. 5 Miami.
''It was a must-win game,'' Jefferson said. ''We lost two games in a row because of, in my opinion, us, because of things we didn't do well. We just had to get back to the basics, get back to things we do so well, the reason why we've been winning games this season.''
Walker scored 13 points in the first quarter - more than he had in the entire game a night earlier - and Jefferson helped Charlotte break it open by scoring 10 points in the first 4 minutes of the fourth quarter.
Walker made seven 3-pointers after going 4 for 16 from the floor in an 11-point night in Toronto.
''You could tell he was disappointed with how we played yesterday and you could tell in the hotel when we were walking through before we came over,'' Hornets coach Steve Clifford said.
Derrick Williams had 17 points and 10 rebounds for the Knicks, who lost for the fifth time in six games. Carmelo Anthony returned from a game off to rest and scored 15 points, but New York remained without injured starters Kristaps Porzingis and Jose Calderon.
The Knicks have three games left to try and avoid another 50-loss season.
''These next couple days are very challenging as athletes, to kind of stay strong and close the season out,'' Anthony said.
The Hornets, who trailed by 10 points after the first quarter of the previous two games, led 30-25 after Walker went 3 for 3 from 3-point range.
It stayed closed for most of the next two periods before Walker sandwiched another 3 between two baskets by Jefferson in a 7-0 burst that made it 81-70 with a minute to go in the third.
Jefferson's big flurry helped the Hornets push the lead to 18 midway through the final period, and after the Knicks got it back to single digits, Walker put it away with a 3-pointer and three-point play on consecutive possessions.
Rookie Frank Kaminsky, making his third start of the season, finished with 16 points. He was in the lineup with forward Nicolas Batum missing a second straight game with a strained left knee.
Hornets: Former Knicks G Jeremy Lin, battling right elbow bursitis, finished 2 for 9 for six points, making a 3-pointer for the game's final basket. ... Clifford said he hoped Batum could return Friday.
Knicks: Robin Lopez was ejected after picking up two technical fouls for arguing a call with 3:32 remaining. ... Former Knicks coaches Derek Fisher and Isiah Thomas worked together in the studio of NBA TV's ''NBA Gametime'' on Wednesday. Fisher, fired in February after 1 1/2 seasons, also will be an analyst Thursday on TNT's ''Inside the NBA'' studio show.
Kurt Rambis said it would be a ''thrill beyond thrills'' if he had the interim tag removed and went into next season as Knicks coach. Though he is close with President of Basketball Operations Phil Jackson and said they communicate daily, Rambis said they haven't discussed his future with the team.
''I want to be a head coach in this league,'' Rambis said. ''This is a great franchise, it's a terrific city, fan base. It would be a thrill beyond thrills in order to take this situation from where it was when we all first came here and turn it into a situation that was extremely promising, where we've got a chance to get into the playoffs and do well in the playoffs and get this city and this organization a potential championship.''
Walker is a New York native who has had plenty of good nights at Madison Square Garden, including a memorable Big East tournament run in 2011 that catapulted Connecticut to a national championship.
''Just the things I've accomplished in this building over the years from college and stuff always brings back great memories,'' he said.
Hornets: Host Brooklyn on Friday.
Knicks: Visit Philadelphia on Friday.