I have problem typing this on the hat of max in the following example:

I have problem typing this on the hat of max in the following example:

Following egreg's suggestion, for math operators that are not defined by default, one can use \operatorname*{...}_{...}^{...}. Or, for typesetting math texts that are not math operators, you can also use the \overset (and \underset) command of the AMSmath package:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\max_{j=1}^{|B|}
\qquad
\operatorname*{argmax}_{j=1}^{|B|}
\]
\[
\underset{j=1}{\overset{|B|}{math \; texts \; \mbox{and regular texts in math mode}}}
\]
\end{document}
For example
\[
\max_{j=1}^{|B|}
\]
$$ notation for LaTeX documents. For much more information on this subject see, e.g., Why is \[ ... \] preferable to $$? and [What are the differences between $$, \, align, equation and displaymath?.
– Mico
Apr 15 '13 at 20:42
=with an!above. Depending on the context,\[ \max_{j=1}^{|B|} ... \]should suffice, since\maxis an operator where the limits are set below/above when in display math. – Werner Apr 15 '13 at 20:31