The following example should work to number solutions within problems only when there are multiple solutions to the same problem. It basically works by defining a command which stores the number of solutions to a given problem in the .aux file, and by redefining the \thesolution command to display the number of the solution according to the number of solutions to the problem. It's a little complicated, and maybe there's a simpler way to do that, but I couldn't think of any.
Here's the example:
\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage{etoolbox}
\newtheorem{problem}{Problem}[subsection]
\theoremstyle{remark}
\newtheorem{solution}{Solution}
\newcounter{numsolution}
\numberwithin{numsolution}{problem}
\makeatletter
\AtBeginEnvironment{problem}{%
\addtocounter{problem}{1}
\newcounter{solsofprob\the\value{section}.\the\value{subsection}.\the\value{problem}}
\addtocounter{problem}{-1}
}
\AtBeginEnvironment{solution}{%
\addtocounter{solsofprob\the\value{section}.\the\value{subsection}.\the\value{problem}}{1}
\immediate\write\@mainaux{\string\gdef\string\numsolsofprob\romannumeral\the\value{section}@\romannumeral\the\value{subsection}@\romannumeral\the\value{problem}{\the\value{solsofprob\the\value{section}.\the\value{subsection}.\the\value{problem}}}}%
}
\newcommand{\tempnum}{0}
\renewcommand{\thesolution}{%
\@ifundefined{numsolsofprob\romannumeral\the\value{section}@\romannumeral\the\value{subsection}@\romannumeral\the\value{problem}}%
{\def\tempnum{0}}%
{\edef\tempnum{\csname numsolsofprob\romannumeral\the\value{section}@\romannumeral\the\value{subsection}@\romannumeral\the\value{problem}\endcsname}}%
\ifnum \tempnum > 1
\stepcounter{numsolution}%
\arabic{section}.\arabic{subsection}.\arabic{problem}--\arabic{numsolution}%
\else
\arabic{section}.\arabic{subsection}.\arabic{problem}%
\fi%
}
\makeatother
\begin{document}
\section{First section}
\subsection{First subsection}
\begin{problem}
A problem.
\end{problem}
\begin{solution}
The solution.
\end{solution}
\begin{problem}
Another problem.
\end{problem}
\begin{solution}
A first solution.
\end{solution}
\begin{solution}
A second solution.
\end{solution}
\begin{problem}
Another problem.
\end{problem}
\begin{solution}
A solution.
\end{solution}
\subsection{Second subsection}
\begin{problem}
A problem.
\end{problem}
\begin{solution}
A solution.
\end{solution}
\section{Second section}
\subsection{A subsection}
\begin{problem}
A problem.
\end{problem}
\begin{solution}
A solution.
\end{solution}
\begin{solution}
Another solution.
\end{solution}
\end{document}
The above codes outputs:

I should also mention that, since this solution works by redefining the \thesolution command in a complicated way, it will not be possible to add a label to a solution to reference it later. I will update the code if I think of something to make to labeling work.